Skip to content

Commit 6d8fcbd

Browse files
committed
picomatch patch → unmatch
1 parent 413c6c1 commit 6d8fcbd

5 files changed

Lines changed: 25 additions & 65 deletions

File tree

package.json

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,11 @@
4242
"homepage": "https://github.com/SuperchupuDev/tinyglobby#readme",
4343
"dependencies": {
4444
"fdir": "^6.4.2",
45-
"picomatch": "^4.0.2"
45+
"unmatch": "^1.0.1"
4646
},
4747
"devDependencies": {
4848
"@biomejs/biome": "^1.9.4",
4949
"@types/node": "^22.9.0",
50-
"@types/picomatch": "^3.0.1",
5150
"fs-fixture": "^2.6.0",
5251
"tsup": "^8.3.5",
5352
"typescript": "^5.6.3"
@@ -59,10 +58,5 @@
5958
"access": "public",
6059
"provenance": true
6160
},
62-
"packageManager": "pnpm@9.13.2",
63-
"pnpm": {
64-
"patchedDependencies": {
65-
"picomatch@4.0.2": "patches/picomatch@4.0.2.patch"
66-
}
67-
}
61+
"packageManager": "pnpm@9.13.2"
6862
}

patches/picomatch@4.0.2.patch

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: 6 additions & 6 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 { isDynamicPattern } from './utils.ts';
55

66
export interface GlobOptions {
@@ -177,21 +177,21 @@ function crawl(options: GlobOptions, cwd: string, sync: boolean) {
177177

178178
const processed = processPatterns(options, cwd, properties);
179179

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

182-
const matcher = picomatch(processed.match, {
182+
const matcher = match(processed.match, {
183183
dot: options.dot,
184184
nocase: options.caseSensitiveMatch === false,
185185
ignore: processed.ignore,
186-
onIgnore: unignoreMatcher ? (result => unignoreMatcher(result.output)) : undefined
186+
onIgnore: unignoreMatcher ? result => unignoreMatcher(result.output) && match.constants.UNIGNORE : undefined
187187
});
188188

189-
const ignore = picomatch(processed.ignore, {
189+
const ignore = match(processed.ignore, {
190190
dot: options.dot,
191191
nocase: options.caseSensitiveMatch === false
192192
});
193193

194-
const exclude = picomatch('*(../)**', {
194+
const exclude = match('*(../)**', {
195195
dot: true,
196196
nocase: options.caseSensitiveMatch === false,
197197
ignore: processed.transformed

src/utils.ts

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

33
// #region convertPathToPattern
44
const ESCAPED_WIN32_BACKSLASHES = /\\(?![()[\]{}!+@])/g;
@@ -49,7 +49,7 @@ export function isDynamicPattern(pattern: string, options?: { caseSensitiveMatch
4949
return true;
5050
}
5151

52-
const scan = picomatch.scan(pattern);
52+
const scan = match.scan(pattern);
5353
return scan.isGlob || scan.negated;
5454
}
5555
// #endregion

0 commit comments

Comments
 (0)