mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-02 11:24:32 +08:00
25 lines
756 B
TypeScript
25 lines
756 B
TypeScript
import { IOptions } from 'glob';
|
|
|
|
import globby = require("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('**'));
|
|
console.log(globby.hasMagic(['**', 'path1', 'path2']));
|
|
console.log(!globby.hasMagic(['path1', 'path2']));
|