mirror of
https://github.com/oven-sh/bun
synced 2026-02-16 22:01:47 +00:00
existsSync should never throw ENAMETOOLONG (#10446)
* existsSync should never throw ENAMETOOLONG * undo PathLike change and use better guard * Apply formatting changes * await promise Co-authored-by: Jarred Sumner <jarred@jarredsumner.com> --------- Co-authored-by: Jarred Sumner <jarred@jarredsumner.com> Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
This commit is contained in:
@@ -1305,6 +1305,10 @@ pub const SliceWithUnderlyingString = struct {
|
||||
return this.utf8.slice();
|
||||
}
|
||||
|
||||
pub fn sliceZ(this: SliceWithUnderlyingString) [:0]const u8 {
|
||||
return this.utf8.sliceZ();
|
||||
}
|
||||
|
||||
pub fn format(self: SliceWithUnderlyingString, comptime fmt: []const u8, opts: std.fmt.FormatOptions, writer: anytype) !void {
|
||||
if (self.utf8.len == 0) {
|
||||
try self.underlying.format(fmt, opts, writer);
|
||||
|
||||
Reference in New Issue
Block a user