Skip to content

Commit

Permalink
Work around TypeScript type problem with URL global (#206)
Browse files Browse the repository at this point in the history
  • Loading branch information
antongolub committed Jan 17, 2022
1 parent a9fc794 commit 1224230
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions index.d.ts
@@ -1,3 +1,4 @@
import {URL} from 'node:url'; // TODO: Remove this when https://github.com/DefinitelyTyped/DefinitelyTyped/issues/34960 is fixed.
import {Options as FastGlobOptions, Entry} from 'fast-glob';

export type GlobEntry = Entry;
Expand Down
3 changes: 3 additions & 0 deletions index.test-d.ts
@@ -1,4 +1,5 @@
import {Buffer} from 'node:buffer';
import {URL} from 'node:url';
import {expectType} from 'tsd';
import {
GlobTask,
Expand Down Expand Up @@ -104,6 +105,8 @@ expectType<GlobTask[]>(generateGlobTasks('*.tmp', {ignore: ['**/b.tmp']}));
expectType<boolean>(isDynamicPattern('**'));
expectType<boolean>(isDynamicPattern(['**', 'path1', 'path2']));
expectType<boolean>(isDynamicPattern(['**', 'path1', 'path2'], {extglob: false}));
expectType<boolean>(isDynamicPattern(['**'], {cwd: new URL('https://example.com')}));
expectType<boolean>(isDynamicPattern(['**'], {cwd: __dirname}));

// IsGitIgnored
expectType<Promise<GlobbyFilterFunction>>(isGitIgnored());
Expand Down

0 comments on commit 1224230

Please sign in to comment.