Skip to content

Commit 1d4922c

Browse files
committed
Update minimatch to avoid type hackery
1 parent dbb7676 commit 1d4922c

File tree

5 files changed

+13
-18
lines changed

5 files changed

+13
-18
lines changed

package-lock.json

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"dependencies": {
2828
"lunr": "^2.3.9",
2929
"marked": "^4.2.12",
30-
"minimatch": "^6.1.6",
30+
"minimatch": "^7.1.3",
3131
"shiki": "^0.14.1"
3232
},
3333
"peerDependencies": {

src/lib/converter/converter.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ export class Converter extends ChildableComponent<
5050
/** @internal */
5151
@BindOption("externalPattern")
5252
externalPattern!: string[];
53-
private externalPatternCache?: InstanceType<typeof Minimatch>[];
54-
private excludeCache?: InstanceType<typeof Minimatch>[];
53+
private externalPatternCache?: Minimatch[];
54+
private excludeCache?: Minimatch[];
5555

5656
/** @internal */
5757
@BindOption("excludeExternals")

src/lib/utils/package-manifest.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ export function expandPackages(
117117
logger: Logger,
118118
packageJsonDir: string,
119119
workspaces: string[],
120-
exclude: InstanceType<typeof Minimatch>[]
120+
exclude: Minimatch[]
121121
): string[] {
122122
// Technically npm and Yarn workspaces don't support recursive nesting,
123123
// however we support the passing of paths to either packages or

src/lib/utils/paths.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ import { normalizePath } from "./fs";
77
*
88
* Handle a few Windows-Unix path gotchas.
99
*/
10-
export function createMinimatch(
11-
patterns: string[]
12-
): InstanceType<typeof Minimatch>[] {
10+
export function createMinimatch(patterns: string[]): Minimatch[] {
1311
return patterns.map(
1412
(pattern) =>
1513
new Minimatch(normalizePath(pattern).replace(/^\w:\//, ""), {
@@ -18,10 +16,7 @@ export function createMinimatch(
1816
);
1917
}
2018

21-
export function matchesAny(
22-
patterns: readonly InstanceType<typeof Minimatch>[],
23-
path: string
24-
) {
19+
export function matchesAny(patterns: readonly Minimatch[], path: string) {
2520
const normPath = normalizePath(path).replace(/^\w:\//, "");
2621
return patterns.some((pat) => pat.match(normPath));
2722
}

0 commit comments

Comments
 (0)