From 518fbb37c72340c7867f39232a60a42148f0d47c Mon Sep 17 00:00:00 2001 From: Bart van der Schoor Date: Mon, 26 May 2014 20:39:20 +0200 Subject: [PATCH] added filter method to minimatch and options optional --- minimatch/minimatch-tests.ts | 2 ++ minimatch/minimatch.d.ts | 13 +++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/minimatch/minimatch-tests.ts b/minimatch/minimatch-tests.ts index a9f4f7e92..a4892ef35 100644 --- a/minimatch/minimatch-tests.ts +++ b/minimatch/minimatch-tests.ts @@ -11,3 +11,5 @@ var r = m.makeRe(); var f = ["test.ts"]; mm.match(f, pattern, options); + +mm.filter('foo')('bar'); diff --git a/minimatch/minimatch.d.ts b/minimatch/minimatch.d.ts index baf246394..e83d976a8 100644 --- a/minimatch/minimatch.d.ts +++ b/minimatch/minimatch.d.ts @@ -8,7 +8,8 @@ declare module "minimatch" { function M(target:string, pattern:string, options?:M.IOptions):void; module M { - function match(filenames:string[], pattern:string, options:IOptions):string[]; + function match(filenames:string[], pattern:string, options?:IOptions):string[]; + function filter(pattern:string, options?:IOptions): (target: string) => boolean; var Minimatch:IMinimatchStatic; @@ -27,7 +28,7 @@ declare module "minimatch" { } interface IMinimatchStatic { - new (pattern:string, options:IOptions):IMinimatch; + new (pattern:string, options?:IOptions):IMinimatch; } interface IMinimatch { @@ -36,11 +37,11 @@ declare module "minimatch" { parseNegate():void; braceExpand(pattern:string, options:IOptions):void; parse(pattern:string, isSub?:boolean):void; - makeRe():any; // regexp or boolean - match(file:string, pattern:string, options:IOptions):boolean; - matchOne(file:string, pattern:string, partial:any):boolean; + makeRe():RegExp; // regexp or boolean + match(file:string):boolean; + matchOne(files:string[], pattern:string[], partial:any):boolean; } } - export = M; +export = M; }