Skip to content

Commit 1224230

Browse files
authoredJan 17, 2022
Work around TypeScript type problem with URL global (#206)
1 parent a9fc794 commit 1224230

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed
 

‎index.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import {URL} from 'node:url'; // TODO: Remove this when https://github.com/DefinitelyTyped/DefinitelyTyped/issues/34960 is fixed.
12
import {Options as FastGlobOptions, Entry} from 'fast-glob';
23

34
export type GlobEntry = Entry;

‎index.test-d.ts

+3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import {Buffer} from 'node:buffer';
2+
import {URL} from 'node:url';
23
import {expectType} from 'tsd';
34
import {
45
GlobTask,
@@ -104,6 +105,8 @@ expectType<GlobTask[]>(generateGlobTasks('*.tmp', {ignore: ['**/b.tmp']}));
104105
expectType<boolean>(isDynamicPattern('**'));
105106
expectType<boolean>(isDynamicPattern(['**', 'path1', 'path2']));
106107
expectType<boolean>(isDynamicPattern(['**', 'path1', 'path2'], {extglob: false}));
108+
expectType<boolean>(isDynamicPattern(['**'], {cwd: new URL('https://example.com')}));
109+
expectType<boolean>(isDynamicPattern(['**'], {cwd: __dirname}));
107110

108111
// IsGitIgnored
109112
expectType<Promise<GlobbyFilterFunction>>(isGitIgnored());

0 commit comments

Comments
 (0)
Please sign in to comment.