import { Glob } from 'glob'; import { fs, fsPath } from './libs'; export interface IGlobOptions { nodir?: boolean; dot?: boolean; ignore?: string; } /** * Matches the given glob pattern as a promise. * See: * https://www.npmjs.com/package/glob */ export function find( pattern: string, options: IGlobOptions = {}, ): Promise { return new Promise((resolve, reject) => { new Glob(pattern, options, (err, matches) => { // tslint:disable-line if (err) { reject(err); } else { resolve(matches); } }); }); }