diff --git a/src/bun.js/api/glob.zig b/src/bun.js/api/glob.zig index 1f1f6f63f6..f4911965e4 100644 --- a/src/bun.js/api/glob.zig +++ b/src/bun.js/api/glob.zig @@ -391,7 +391,7 @@ pub fn match(this: *Glob, globalThis: *JSGlobalObject, callframe: *JSC.CallFrame var str = try str_arg.toSlice(globalThis, arena.allocator()); defer str.deinit(); - return JSC.JSValue.jsBoolean(globImpl.Ascii.match(arena.allocator(), this.pattern, str.slice()).matches()); + return JSC.JSValue.jsBoolean(globImpl.match(arena.allocator(), this.pattern, str.slice()).matches()); } pub fn convertUtf8(codepoints: *std.ArrayList(u32), pattern: []const u8) !void { diff --git a/src/glob.zig b/src/glob.zig index 09248b37ae..5519351638 100644 --- a/src/glob.zig +++ b/src/glob.zig @@ -1,5 +1,7 @@ pub const walk = @import("./glob/GlobWalker.zig"); -pub const Ascii = @import("./glob/ascii.zig"); +pub const match_impl = @import("./glob/match.zig"); +pub const match = match_impl.match; +pub const detectGlobSyntax = match_impl.detectGlobSyntax; pub const GlobWalker = walk.GlobWalker_; pub const BunGlobWalker = GlobWalker(null, walk.SyscallAccessor, false); diff --git a/src/glob/GlobWalker.zig b/src/glob/GlobWalker.zig index 4b91659dc4..8aca8e3990 100644 --- a/src/glob/GlobWalker.zig +++ b/src/glob/GlobWalker.zig @@ -41,7 +41,7 @@ const Codepoint = CodepointIterator.Cursor.CodePointType; const Dirent = @import("../bun.js/node/types.zig").Dirent; const DirIterator = @import("../bun.js/node/dir_iterator.zig"); const EntryKind = @import("../bun.js/node/types.zig").Dirent.Kind; -const GlobAscii = @import("./ascii.zig"); +const match = @import("./match.zig").match; const JSC = bun.JSC; const Maybe = JSC.Maybe; const PathLike = @import("../bun.js/node/types.zig").PathLike; @@ -337,8 +337,6 @@ pub fn GlobWalker_( /// not owned by this struct pattern: []const u8 = "", - cp_len: u32 = 0, - /// If the pattern contains "./" or "../" has_relative_components: bool = false, @@ -1333,7 +1331,7 @@ pub fn GlobWalker_( } fn matchPatternSlow(this: *GlobWalker, pattern_component: *Component, filepath: []const u8) bool { - return GlobAscii.match( + return match( this.arena.allocator(), pattern_component.patternSlice(this.pattern), filepath, @@ -1729,4 +1727,4 @@ pub fn matchWildcardLiteral(literal: []const u8, path: []const u8) bool { return std.mem.eql(u8, literal, path); } -pub const matchImpl = GlobAscii.match; +pub const matchImpl = match; diff --git a/src/glob/ascii.zig b/src/glob/match.zig similarity index 100% rename from src/glob/ascii.zig rename to src/glob/match.zig diff --git a/src/install/lockfile.zig b/src/install/lockfile.zig index 7c60078521..f8b879b823 100644 --- a/src/install/lockfile.zig +++ b/src/install/lockfile.zig @@ -5045,7 +5045,7 @@ pub const Package = extern struct { if (input_path.len == 0 or input_path.len == 1 and input_path[0] == '.') continue; - if (Glob.Ascii.detectGlobSyntax(input_path)) { + if (Glob.detectGlobSyntax(input_path)) { workspace_globs.append(input_path) catch bun.outOfMemory(); continue; }