Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3aecd8a
commit 8942da8
Showing
5 changed files
with
50 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import {IOptions} from 'minimatch'; | ||
|
||
declare namespace multimatch { | ||
type Options = Readonly<IOptions>; | ||
} | ||
|
||
/** | ||
Extends [`minimatch.match()`](https://github.com/isaacs/minimatch#minimatchmatchlist-pattern-options) with support for multiple patterns. | ||
@param paths - Paths to match against. | ||
@param patterns - Globbing patterns to use. e.g. `[*, "!cake"]`. See supported [`minimatch` patterns](https://github.com/isaacs/minimatch#usage). | ||
@returns The matching paths. | ||
@example | ||
``` | ||
import multimatch = require('multimatch'); | ||
multimatch(['unicorn', 'cake', 'rainbows'], ['*', '!cake']); | ||
//=> ['unicorn', 'rainbows'] | ||
``` | ||
*/ | ||
declare function multimatch( | ||
paths: string | string[], | ||
patterns: string | string[], | ||
options?: multimatch.Options | ||
): string[]; | ||
|
||
export = multimatch; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import multimatch = require('.'); | ||
|
||
const options: multimatch.Options = {}; | ||
|
||
multimatch(['unicorn', 'cake', 'rainbows'], '!cake'); | ||
multimatch(['unicorn', 'cake', 'rainbows'], ['*', '!cake']); | ||
multimatch(['unicorn', 'cake', 'rainbows'], ['*', '!cake'], { | ||
debug: true | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters