Skip to content

Commit f2419f8

Browse files
chore(deps): update dependency @types/picomatch to v4 (#104)
* chore(deps): update dependency @types/picomatch to v4 * make typescript happy --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Superchupu <53496941+SuperchupuDev@users.noreply.github.com>
1 parent be4463c commit f2419f8

File tree

4 files changed

+12
-9
lines changed

4 files changed

+12
-9
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"devDependencies": {
5151
"@biomejs/biome": "^1.9.4",
5252
"@types/node": "^22.14.1",
53-
"@types/picomatch": "^3.0.2",
53+
"@types/picomatch": "^4.0.0",
5454
"fs-fixture": "^2.7.1",
5555
"tsup": "^8.4.0",
5656
"typescript": "^5.8.3"

pnpm-lock.yaml

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

src/utils.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
1-
import picomatch, { type Matcher } from 'picomatch';
1+
import picomatch from 'picomatch';
22

33
// #region PARTIAL MATCHER
44
export interface PartialMatcherOptions {
55
dot?: boolean;
66
nocase?: boolean;
77
}
88

9+
// can't use `Matcher` from picomatch as it requires a second argument since @types/picomatch v4
10+
type PartialMatcher = (test: string) => boolean;
11+
912
const ONLY_PARENT_DIRECTORIES = /^(\/?\.\.)+$/;
1013

1114
// the result of over 4 months of figuring stuff out and a LOT of help
12-
export function getPartialMatcher(patterns: string[], options?: PartialMatcherOptions): Matcher {
15+
export function getPartialMatcher(patterns: string[], options?: PartialMatcherOptions): PartialMatcher {
1316
// you might find this code pattern odd, but apparently it's faster than using `.push()`
1417
const patternsCount = patterns.length;
1518
const patternsParts: string[][] = Array(patternsCount);

test/index.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ test('classic patterns as first argument', async () => {
5252
assert.deepEqual(files.sort(), ['a/a.txt', 'a/b.txt']);
5353
});
5454

55-
test("cant have both classic patterns and options' patterns", async () => {
55+
test("can't have both classic patterns and options' patterns", async () => {
5656
// @ts-expect-error
5757
assert.rejects(glob(['a/*.txt'], { patterns: ['whoops!'], cwd }));
5858

0 commit comments

Comments
 (0)