Skip to content

Commit

Permalink
make globbing about 8 times faster in some cases
Browse files Browse the repository at this point in the history
Co-authored-by: Joachim Viide <[email protected]>
  • Loading branch information
SuperchupuDev and jviide committed Jul 26, 2024
1 parent 0ec5b5f commit 16ca69d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,14 @@ function getFdirBuilder(options: GlobOptions, cwd: string) {
ignore: processed.ignore
});

const exclude = picomatch(processed.ignore, {
dot: options.dot
});

const fdirOptions: Partial<FdirOptions> = {
// use relative paths in the matcher
filters: [options.absolute ? p => matcher(p.slice(cwd.length + 1)) : matcher],
filters: [p => matcher(options.absolute ? p.slice(cwd.length + 1) : p)],
exclude: (_, p) => exclude(p.slice(cwd.length + 1)),
relativePaths: true
};

Expand Down

0 comments on commit 16ca69d

Please sign in to comment.