mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-23 21:00:01 +08:00
28 lines
780 B
TypeScript
28 lines
780 B
TypeScript
//
|
|
|
|
import { IOptions } from 'glob';
|
|
|
|
import * as globby from "globby";
|
|
|
|
(async () => {
|
|
let result: string[];
|
|
result = await globby('*.tmp')
|
|
result = await globby(['a.tmp', '*.tmp', '!{c,d,e}.tmp'])
|
|
|
|
result = globby.sync('*.tmp')
|
|
result = globby.sync(['a.tmp', '*.tmp', '!{c,d,e}.tmp'])
|
|
|
|
result = await globby('*.tmp', Object.freeze({ignore: Object.freeze([])}))
|
|
result = globby.sync('*.tmp', Object.freeze({ignore: Object.freeze([])}))
|
|
})()
|
|
|
|
|
|
const tasks: Array<{
|
|
pattern: string,
|
|
options: IOptions
|
|
}> = globby.generateGlobTasks(['*.tmp', '!b.tmp'], {ignore: ['c.tmp']});
|
|
|
|
console.log(globby.hasMagic('**') === true);
|
|
console.log(globby.hasMagic(['**', 'path1', 'path2']) === true);
|
|
console.log(globby.hasMagic(['path1', 'path2']) === false);
|