Skip to content

Commit b603afc

Browse files
committed
picomatch patch → unmatch
1 parent f15ca04 commit b603afc

File tree

5 files changed

+26
-66
lines changed

5 files changed

+26
-66
lines changed

package.json

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,11 @@
4545
},
4646
"dependencies": {
4747
"fdir": "^6.4.3",
48-
"picomatch": "^4.0.2"
48+
"unmatch": "^1.0.1"
4949
},
5050
"devDependencies": {
5151
"@biomejs/biome": "^1.9.4",
5252
"@types/node": "^22.13.4",
53-
"@types/picomatch": "^3.0.2",
5453
"fs-fixture": "^2.7.0",
5554
"tsup": "^8.3.6",
5655
"typescript": "^5.7.3"
@@ -62,10 +61,5 @@
6261
"access": "public",
6362
"provenance": true
6463
},
65-
"packageManager": "[email protected]",
66-
"pnpm": {
67-
"patchedDependencies": {
68-
69-
}
70-
}
64+
"packageManager": "[email protected]"
7165
}

patches/[email protected]

Lines changed: 0 additions & 27 deletions
This file was deleted.

pnpm-lock.yaml

Lines changed: 15 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/index.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import path, { posix } from 'node:path';
22
import { type Options as FdirOptions, fdir } from 'fdir';
3-
import picomatch from 'picomatch';
3+
import match from 'unmatch';
44
import { escapePath, getPartialMatcher, isDynamicPattern, log, splitPattern } from './utils.ts';
55

66
const PARENT_DIRECTORY = /^(\/?\.\.)+/;
@@ -184,16 +184,16 @@ function crawl(options: GlobOptions, cwd: string, sync: boolean) {
184184
log('internal processing patterns:', processed);
185185
}
186186

187-
const unignoreMatcher = processed.unignore.length === 0 ? undefined : picomatch(processed.unignore);
187+
const unignoreMatcher = processed.unignore.length === 0 ? undefined : match(processed.unignore);
188188

189-
const matcher = picomatch(processed.match, {
189+
const matcher = match(processed.match, {
190190
dot: options.dot,
191191
nocase,
192192
ignore: processed.ignore,
193-
onIgnore: unignoreMatcher ? result => unignoreMatcher(result.output) : undefined
193+
onIgnore: unignoreMatcher ? result => unignoreMatcher(result.output) && match.constants.UNIGNORE : undefined
194194
});
195195

196-
const ignore = picomatch(processed.ignore, {
196+
const ignore = match(processed.ignore, {
197197
dot: options.dot,
198198
nocase
199199
});

src/utils.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import picomatch, { type Matcher } from 'picomatch';
1+
import match, { type Matcher } from 'unmatch';
22

33
// #region PARTIAL MATCHER
44
export interface PartialMatcherOptions {
@@ -18,7 +18,7 @@ export function getPartialMatcher(patterns: string[], options?: PartialMatcherOp
1818
const partsCount = parts.length;
1919
const partRegexes = Array(partsCount);
2020
for (let j = 0; j < partsCount; j++) {
21-
partRegexes[j] = picomatch.makeRe(parts[j], options);
21+
partRegexes[j] = match.makeRe(parts[j], options);
2222
}
2323
regexes[i] = partRegexes;
2424
}
@@ -72,7 +72,7 @@ const splitPatternOptions = { parts: true };
7272

7373
// if a pattern has no slashes outside glob symbols, results.parts is []
7474
export function splitPattern(path: string): string[] {
75-
const result = picomatch.scan(path, splitPatternOptions);
75+
const result = match.scan(path, splitPatternOptions);
7676
return result.parts?.length ? result.parts : [path];
7777
}
7878
// #endregion
@@ -129,7 +129,7 @@ export function isDynamicPattern(pattern: string, options?: { caseSensitiveMatch
129129
return true;
130130
}
131131

132-
const scan = picomatch.scan(pattern);
132+
const scan = match.scan(pattern);
133133
return scan.isGlob || scan.negated;
134134
}
135135
// #endregion

0 commit comments

Comments
 (0)