diff --git a/index.js b/index.js index 5c302d2..97eb710 100644 --- a/index.js +++ b/index.js @@ -18498,7 +18498,14 @@ var import_micromatch = __toModule(require_micromatch()); var shouldExcludePath = (path, pathsToIgnore, globsToIgnore) => { if (!path) return false; - return pathsToIgnore.has(path) || globsToIgnore.some((glob) => glob && (0, import_micromatch.isMatch)(path, glob)); + return pathsToIgnore.has(path) || globsToIgnore.some((glob) => glob && (0, import_micromatch.isMatch)(processPath(path), glob, { + dot: true + })); +}; +var processPath = (path) => { + if (path.startsWith("./")) + return path.substring(2); + return path; }; // src/process-dir.js diff --git a/src/should-exclude-path.ts b/src/should-exclude-path.ts index 82dcff3..e867d5a 100644 --- a/src/should-exclude-path.ts +++ b/src/should-exclude-path.ts @@ -1,11 +1,29 @@ -import { isMatch } from 'micromatch'; +import { isMatch } from "micromatch"; /** * True if path is excluded by either the path or glob criteria. * path may be to a directory or individual file. */ -export const shouldExcludePath = (path: string, pathsToIgnore: Set, globsToIgnore: string[]): boolean => { - if (!path) return false +export const shouldExcludePath = ( + path: string, + pathsToIgnore: Set, + globsToIgnore: string[] +): boolean => { + if (!path) return false; - return pathsToIgnore.has(path) || globsToIgnore.some(glob => glob && isMatch(path, glob)); -} + return ( + pathsToIgnore.has(path) || + globsToIgnore.some( + (glob) => + glob && + isMatch(processPath(path), glob, { + dot: true, + }) + ) + ); +}; + +const processPath = (path: string): string => { + if (path.startsWith("./")) return path.substring(2); + return path; +};