glob: allow ReadonlyArray in input position

This commit is contained in:
Klaus Meinhardt 2018-09-20 10:33:00 +02:00
parent 14d0a6329a
commit 29973b4a91
2 changed files with 5 additions and 4 deletions

View File

@ -29,5 +29,6 @@ const Glob = glob.Glob;
console.log("after");
})();
declare const ignore: ReadonlyArray<string>;
glob.sync('/foo/*', {realpath: true, realpathCache: {'/foo/bar': '/bar'}, ignore: '/foo/baz'});
glob.sync('/*', {nodir: true, cache: {'/': ['bar', 'baz']}, statCache: {'/foo/bar': false, '/foo/baz': {isDirectory() { return true; }}}});
glob.sync('/*', {ignore, nodir: true, cache: {'/': ['bar', 'baz']}, statCache: {'/foo/bar': false, '/foo/baz': {isDirectory() { return true; }}}});

View File

@ -33,7 +33,7 @@ declare namespace G {
stat?: boolean;
silent?: boolean;
strict?: boolean;
cache?: { [path: string]: boolean | 'DIR' | 'FILE' | string[] };
cache?: { [path: string]: boolean | 'DIR' | 'FILE' | ReadonlyArray<string> };
statCache?: { [path: string]: false | { isDirectory(): boolean} | undefined };
symlinks?: { [path: string]: boolean | undefined };
realpathCache?: { [path: string]: string };
@ -47,7 +47,7 @@ declare namespace G {
nocase?: boolean;
matchBase?: any;
nodir?: boolean;
ignore?: string | string[];
ignore?: string | ReadonlyArray<string>;
follow?: boolean;
realpath?: boolean;
nonegate?: boolean;
@ -70,7 +70,7 @@ declare namespace G {
minimatch: minimatch.IMinimatch;
options: IOptions;
aborted: boolean;
cache: { [path: string]: boolean | 'DIR' | 'FILE' | string[] };
cache: { [path: string]: boolean | 'DIR' | 'FILE' | ReadonlyArray<string> };
statCache: { [path: string]: false | { isDirectory(): boolean; } | undefined };
symlinks: { [path: string]: boolean | undefined };
realpathCache: { [path: string]: string };