mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-08-30 11:14:27 +08:00
@@ -0,0 +1,22 @@
|
||||
/// <reference path="./glob-expand.d.ts" />
|
||||
|
||||
import * as expand from "glob-expand";
|
||||
|
||||
expand({ filter: 'isFile', cwd: '../' }, ['**/*.*', '!exclude/these/**/*.*']);
|
||||
// returns all files in cwd ['file1', 'file2',...] but excluding
|
||||
// those under directory 'exclude/these'
|
||||
|
||||
// These are the same
|
||||
expand({ cwd: '../..' }, ['**/*.*', '!node_modules/**/*.*']);
|
||||
expand({ cwd: '../..' }, '**/*.*', '!node_modules/**/*.*');
|
||||
|
||||
// These are the same too:
|
||||
expand({}, ['**/*.*', '!**/*.js']);
|
||||
expand({}, '**/*.*', '!**/*.js');
|
||||
expand(['**/*.*', '!**/*.js']);
|
||||
expand('**/*.*', '!**/*.js');
|
||||
|
||||
// Using Regular Expressions:
|
||||
expand('**/*.js', /.*\.(coffee\.md|litcoffee|coffee)$/i, '!DRAFT*.*');
|
||||
// -> returns all `.js`, `.coffee`, `.coffee.md` & `.litcoffee` files,
|
||||
// excluding those starting with 'DRAFT'
|
||||
Vendored
+27
@@ -0,0 +1,27 @@
|
||||
// Type definitions for glob-expand
|
||||
// Project: https://github.com/anodynos/node-glob-expand
|
||||
// Definitions by: vvakame <https://github.com/vvakame/>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../glob/glob.d.ts" />
|
||||
|
||||
declare module "glob-expand" {
|
||||
import * as _glob from "glob";
|
||||
|
||||
interface Option {
|
||||
filter?: string | ((filePath: string) => boolean);
|
||||
cwd?: string;
|
||||
}
|
||||
|
||||
module expand {
|
||||
var glob: typeof _glob;
|
||||
var VERSION: string;
|
||||
}
|
||||
|
||||
function expand(opts: Option, patterns: (string | RegExp)[]): string[];
|
||||
function expand(opts: Option, ...patterns: (string | RegExp)[]): string[];
|
||||
function expand(patterns: (string | RegExp)[]): string[];
|
||||
function expand(...patterns: (string | RegExp)[]): string[];
|
||||
|
||||
export = expand;
|
||||
}
|
||||
Reference in New Issue
Block a user