-
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Require Node.js 12.20 and move to ESM
- Loading branch information
1 parent
108cd25
commit d841a69
Showing
8 changed files
with
33 additions
and
39 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
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 |
---|---|---|
@@ -1,28 +1,25 @@ | ||
import {IOptions} from 'minimatch'; | ||
|
||
declare namespace multimatch { | ||
type Options = Readonly<IOptions>; | ||
} | ||
export 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 paths - The paths to match against. | ||
@param patterns - Globbing patterns to use. For example: `['*', '!cake']`. See supported [`minimatch` patterns](https://github.com/isaacs/minimatch#usage). | ||
@returns The matching paths in the order of input paths. | ||
@example | ||
``` | ||
import multimatch = require('multimatch'); | ||
import multimatch from 'multimatch'; | ||
multimatch(['unicorn', 'cake', 'rainbows'], ['*', '!cake']); | ||
//=> ['unicorn', 'rainbows'] | ||
``` | ||
*/ | ||
declare function multimatch( | ||
export default function multimatch( | ||
paths: string | readonly string[], | ||
patterns: string | readonly string[], | ||
options?: multimatch.Options | ||
options?: 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 |
---|---|---|
@@ -1,10 +1,10 @@ | ||
import multimatch = require('.'); | ||
import multimatch, {Options} from './index.js'; | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
const options: multimatch.Options = {}; | ||
const options: Options = {}; | ||
|
||
multimatch(['unicorn', 'cake', 'rainbows'], '!cake'); | ||
multimatch(['unicorn', 'cake', 'rainbows'], ['*', '!cake']); | ||
multimatch(['unicorn', 'cake', 'rainbows'], ['*', '!cake'], { | ||
debug: true | ||
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
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