update
This commit is contained in:
+73
-62
@@ -1,4 +1,4 @@
|
||||
# micromatch [](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=W8YFZ425KND68) [](https://www.npmjs.com/package/micromatch) [](https://npmjs.org/package/micromatch) [](https://npmjs.org/package/micromatch) [](https://travis-ci.org/micromatch/micromatch)
|
||||
# micromatch [](https://www.npmjs.com/package/micromatch) [](https://npmjs.org/package/micromatch) [](https://npmjs.org/package/micromatch) [](https://github.com/micromatch/micromatch/actions/workflows/test.yml)
|
||||
|
||||
> Glob matching for javascript/node.js. A replacement and faster alternative to minimatch and multimatch.
|
||||
|
||||
@@ -54,7 +54,7 @@ Please consider following this project's author, [Jon Schlinkert](https://github
|
||||
|
||||
## Install
|
||||
|
||||
Install with [npm](https://www.npmjs.com/):
|
||||
Install with [npm](https://www.npmjs.com/) (requires [Node.js](https://nodejs.org/en/) >=8.6):
|
||||
|
||||
```sh
|
||||
$ npm install --save micromatch
|
||||
@@ -93,7 +93,7 @@ console.log(micromatch.isMatch('foo', ['b*', 'f*'])) //=> true
|
||||
* More complete support for the Bash 4.3 specification than minimatch and multimatch. Micromatch passes _all of the spec tests_ from bash, including some that bash still fails.
|
||||
* **Fast & Performant** - Loads in about 5ms and performs [fast matches](#benchmarks).
|
||||
* **Glob matching** - Using wildcards (`*` and `?`), globstars (`**`) for nested directories
|
||||
* **[Advanced globbing](#advanced-globbing)** - Supports [extglobs](#extglobs), [braces](#braces), and [POSIX brackets](#posix-bracket-expressions), and support for escaping special characters with `\` or quotes.
|
||||
* **[Advanced globbing](#extended-globbing)** - Supports [extglobs](#extglobs), [braces](#braces-1), and [POSIX brackets](#posix-bracket-expressions), and support for escaping special characters with `\` or quotes.
|
||||
* **Accurate** - Covers more scenarios [than minimatch](https://github.com/yarnpkg/yarn/pull/3339)
|
||||
* **Well tested** - More than 5,000 [test assertions](./test)
|
||||
* **Windows support** - More reliable windows support than minimatch and multimatch.
|
||||
@@ -103,7 +103,7 @@ console.log(micromatch.isMatch('foo', ['b*', 'f*'])) //=> true
|
||||
|
||||
* Support for multiple glob patterns (no need for wrappers like multimatch)
|
||||
* Wildcards (`**`, `*.js`)
|
||||
* Negation (`'!a/*.js'`, `'*!(b).js']`)
|
||||
* Negation (`'!a/*.js'`, `'*!(b).js'`)
|
||||
* [extglobs](#extglobs) (`+(x|y)`, `!(a|b)`)
|
||||
* [POSIX character classes](#posix-bracket-expressions) (`[[:alpha:][:digit:]]`)
|
||||
* [brace expansion](https://github.com/micromatch/braces) (`foo/{1..5}.md`, `bar/{a,b,c}.js`)
|
||||
@@ -142,9 +142,9 @@ console.log(micromatch(['foo', 'bar', 'baz'], ['f*', '*z'])); //=> ['foo', 'baz'
|
||||
|
||||
**Params**
|
||||
|
||||
* **{String|Array<string>}**: list List of strings to match.
|
||||
* **{String|Array<string>}**: patterns One or more glob patterns to use for matching.
|
||||
* **{Object}**: options See available [options](#options)
|
||||
* `list` **{String|Array<string>}**: List of strings to match.
|
||||
* `patterns` **{String|Array<string>}**: One or more glob patterns to use for matching.
|
||||
* `options` **{Object}**: See available [options](#options)
|
||||
* `returns` **{Array}**: Returns an array of matches
|
||||
|
||||
**Example**
|
||||
@@ -157,7 +157,7 @@ console.log(mm(['a.js', 'a.txt'], ['*.js']));
|
||||
//=> [ 'a.js' ]
|
||||
```
|
||||
|
||||
### [.matcher](index.js#L98)
|
||||
### [.matcher](index.js#L104)
|
||||
|
||||
Returns a matcher function from the given glob `pattern` and `options`. The returned function takes a string to match as its only argument and returns true if the string is a match.
|
||||
|
||||
@@ -178,15 +178,15 @@ console.log(isMatch('a.a')); //=> false
|
||||
console.log(isMatch('a.b')); //=> true
|
||||
```
|
||||
|
||||
### [.isMatch](index.js#L117)
|
||||
### [.isMatch](index.js#L123)
|
||||
|
||||
Returns true if **any** of the given glob `patterns` match the specified `string`.
|
||||
|
||||
**Params**
|
||||
|
||||
* **{String}**: str The string to test.
|
||||
* **{String|Array}**: patterns One or more glob patterns to use for matching.
|
||||
* **{Object}**: See available [options](#options).
|
||||
* `str` **{String}**: The string to test.
|
||||
* `patterns` **{String|Array}**: One or more glob patterns to use for matching.
|
||||
* `[options]` **{Object}**: See available [options](#options).
|
||||
* `returns` **{Boolean}**: Returns true if any patterns match `str`
|
||||
|
||||
**Example**
|
||||
@@ -199,7 +199,7 @@ console.log(mm.isMatch('a.a', ['b.*', '*.a'])); //=> true
|
||||
console.log(mm.isMatch('a.a', 'b.*')); //=> false
|
||||
```
|
||||
|
||||
### [.not](index.js#L136)
|
||||
### [.not](index.js#L148)
|
||||
|
||||
Returns a list of strings that _**do not match any**_ of the given `patterns`.
|
||||
|
||||
@@ -220,7 +220,7 @@ console.log(mm.not(['a.a', 'b.b', 'c.c'], '*.a'));
|
||||
//=> ['b.b', 'c.c']
|
||||
```
|
||||
|
||||
### [.contains](index.js#L176)
|
||||
### [.contains](index.js#L188)
|
||||
|
||||
Returns true if the given `string` contains the given pattern. Similar to [.isMatch](#isMatch) but the pattern can match any part of the string.
|
||||
|
||||
@@ -229,7 +229,7 @@ Returns true if the given `string` contains the given pattern. Similar to [.isMa
|
||||
* `str` **{String}**: The string to match.
|
||||
* `patterns` **{String|Array}**: Glob pattern to use for matching.
|
||||
* `options` **{Object}**: See available [options](#options) for changing how matches are performed
|
||||
* `returns` **{Boolean}**: Returns true if the patter matches any part of `str`.
|
||||
* `returns` **{Boolean}**: Returns true if any of the patterns matches any part of `str`.
|
||||
|
||||
**Example**
|
||||
|
||||
@@ -243,7 +243,7 @@ console.log(mm.contains('aa/bb/cc', '*d'));
|
||||
//=> false
|
||||
```
|
||||
|
||||
### [.matchKeys](index.js#L218)
|
||||
### [.matchKeys](index.js#L230)
|
||||
|
||||
Filter the keys of the given object with the given `glob` pattern and `options`. Does not attempt to match nested keys. If you need this feature, use [glob-object](https://github.com/jonschlinkert/glob-object) instead.
|
||||
|
||||
@@ -265,7 +265,7 @@ console.log(mm.matchKeys(obj, '*b'));
|
||||
//=> { ab: 'b' }
|
||||
```
|
||||
|
||||
### [.some](index.js#L247)
|
||||
### [.some](index.js#L259)
|
||||
|
||||
Returns true if some of the strings in the given `list` match any of the given glob `patterns`.
|
||||
|
||||
@@ -274,7 +274,7 @@ Returns true if some of the strings in the given `list` match any of the given g
|
||||
* `list` **{String|Array}**: The string or array of strings to test. Returns as soon as the first match is found.
|
||||
* `patterns` **{String|Array}**: One or more glob patterns to use for matching.
|
||||
* `options` **{Object}**: See available [options](#options) for changing how matches are performed
|
||||
* `returns` **{Boolean}**: Returns true if any patterns match `str`
|
||||
* `returns` **{Boolean}**: Returns true if any `patterns` matches any of the strings in `list`
|
||||
|
||||
**Example**
|
||||
|
||||
@@ -288,7 +288,7 @@ console.log(mm.some(['foo.js'], ['*.js', '!foo.js']));
|
||||
// false
|
||||
```
|
||||
|
||||
### [.every](index.js#L283)
|
||||
### [.every](index.js#L295)
|
||||
|
||||
Returns true if every string in the given `list` matches any of the given glob `patterns`.
|
||||
|
||||
@@ -297,7 +297,7 @@ Returns true if every string in the given `list` matches any of the given glob `
|
||||
* `list` **{String|Array}**: The string or array of strings to test.
|
||||
* `patterns` **{String|Array}**: One or more glob patterns to use for matching.
|
||||
* `options` **{Object}**: See available [options](#options) for changing how matches are performed
|
||||
* `returns` **{Boolean}**: Returns true if any patterns match `str`
|
||||
* `returns` **{Boolean}**: Returns true if all `patterns` matches all of the strings in `list`
|
||||
|
||||
**Example**
|
||||
|
||||
@@ -315,7 +315,7 @@ console.log(mm.every(['foo.js'], ['*.js', '!foo.js']));
|
||||
// false
|
||||
```
|
||||
|
||||
### [.all](index.js#L322)
|
||||
### [.all](index.js#L334)
|
||||
|
||||
Returns true if **all** of the given `patterns` match the specified string.
|
||||
|
||||
@@ -345,7 +345,7 @@ console.log(mm.all('foo.js', ['*.js', 'f*', '*o*', '*o.js']));
|
||||
// true
|
||||
```
|
||||
|
||||
### [.capture](index.js#L349)
|
||||
### [.capture](index.js#L361)
|
||||
|
||||
Returns an array of matches captured by `pattern` in `string, or`null` if the pattern did not match.
|
||||
|
||||
@@ -354,7 +354,7 @@ Returns an array of matches captured by `pattern` in `string, or`null` if the pa
|
||||
* `glob` **{String}**: Glob pattern to use for matching.
|
||||
* `input` **{String}**: String to match
|
||||
* `options` **{Object}**: See available [options](#options) for changing how matches are performed
|
||||
* `returns` **{Boolean}**: Returns an array of captures if the input matches the glob pattern, otherwise `null`.
|
||||
* `returns` **{Array|null}**: Returns an array of captures if the input matches the glob pattern, otherwise `null`.
|
||||
|
||||
**Example**
|
||||
|
||||
@@ -368,7 +368,7 @@ console.log(mm.capture('test/*.js', 'foo/bar.css'));
|
||||
//=> null
|
||||
```
|
||||
|
||||
### [.makeRe](index.js#L375)
|
||||
### [.makeRe](index.js#L387)
|
||||
|
||||
Create a regular expression from the given glob `pattern`.
|
||||
|
||||
@@ -388,7 +388,7 @@ console.log(mm.makeRe('*.js'));
|
||||
//=> /^(?:(\.[\\\/])?(?!\.)(?=.)[^\/]*?\.js)$/
|
||||
```
|
||||
|
||||
### [.scan](index.js#L391)
|
||||
### [.scan](index.js#L403)
|
||||
|
||||
Scan a glob pattern to separate the pattern into segments. Used by the [split](#split) method.
|
||||
|
||||
@@ -405,7 +405,7 @@ const mm = require('micromatch');
|
||||
const state = mm.scan(pattern[, options]);
|
||||
```
|
||||
|
||||
### [.parse](index.js#L407)
|
||||
### [.parse](index.js#L419)
|
||||
|
||||
Parse a glob pattern to create the source string for a regular expression.
|
||||
|
||||
@@ -419,10 +419,10 @@ Parse a glob pattern to create the source string for a regular expression.
|
||||
|
||||
```js
|
||||
const mm = require('micromatch');
|
||||
const state = mm(pattern[, options]);
|
||||
const state = mm.parse(pattern[, options]);
|
||||
```
|
||||
|
||||
### [.braces](index.js#L434)
|
||||
### [.braces](index.js#L446)
|
||||
|
||||
Process the given brace `pattern`.
|
||||
|
||||
@@ -479,7 +479,7 @@ console.log(braces('foo/{a,b,c}/bar', { expand: true }));
|
||||
| [onResult](#optionsonResult) | `function` | `undefined` | Function to be called on all items, regardless of whether or not they are matched or ignored. |
|
||||
| `posix` | `boolean` | `false` | Support [POSIX character classes](#posix-bracket-expressions) ("posix brackets"). |
|
||||
| `posixSlashes` | `boolean` | `undefined` | Convert all slashes in file paths to forward slashes. This does not convert slashes in the glob pattern itself |
|
||||
| `prepend` | `boolean` | `undefined` | String to prepend to the generated regex used for matching. |
|
||||
| `prepend` | `string` | `undefined` | String to prepend to the generated regex used for matching. |
|
||||
| `regex` | `boolean` | `false` | Use regular expression rules for `+` (instead of matching literal `+`), and for stars that follow closing parentheses or brackets (as in `)*` and `]*`). |
|
||||
| `strictBrackets` | `boolean` | `undefined` | Throw an error if brackets, braces, or parens are imbalanced. |
|
||||
| `strictSlashes` | `boolean` | `undefined` | When true, picomatch won't match trailing slashes with single stars. |
|
||||
@@ -772,7 +772,6 @@ Given the list: `['a.js', 'b.js', 'c.js', 'd.js', 'E.js']`:
|
||||
|
||||
* `[ac].js`: matches both `a` and `c`, returning `['a.js', 'c.js']`
|
||||
* `[b-d].js`: matches from `b` to `d`, returning `['b.js', 'c.js', 'd.js']`
|
||||
* `[b-d].js`: matches from `b` to `d`, returning `['b.js', 'c.js', 'd.js']`
|
||||
* `a/[A-Z].js`: matches and uppercase letter, returning `['a/E.md']`
|
||||
|
||||
Learn about [regex character classes](http://www.regular-expressions.info/charclass.html).
|
||||
@@ -835,7 +834,7 @@ To solve this, you might be inspired to do something like `'foo\\*'.replace(/\\/
|
||||
Install dependencies for running benchmarks:
|
||||
|
||||
```sh
|
||||
$ cd bench && npm install
|
||||
$ cd bench && npm install
|
||||
```
|
||||
|
||||
Run the benchmarks:
|
||||
@@ -846,56 +845,56 @@ $ npm run bench
|
||||
|
||||
### Latest results
|
||||
|
||||
As of April 10, 2019 (longer bars are better):
|
||||
As of March 24, 2022 (longer bars are better):
|
||||
|
||||
```sh
|
||||
# .makeRe star
|
||||
micromatch x 1,724,735 ops/sec ±1.69% (87 runs sampled))
|
||||
minimatch x 649,565 ops/sec ±1.93% (91 runs sampled)
|
||||
micromatch x 2,232,802 ops/sec ±2.34% (89 runs sampled))
|
||||
minimatch x 781,018 ops/sec ±6.74% (92 runs sampled))
|
||||
|
||||
# .makeRe star; dot=true
|
||||
micromatch x 1,302,127 ops/sec ±1.43% (92 runs sampled)
|
||||
minimatch x 556,242 ops/sec ±0.71% (86 runs sampled)
|
||||
micromatch x 1,863,453 ops/sec ±0.74% (93 runs sampled)
|
||||
minimatch x 723,105 ops/sec ±0.75% (93 runs sampled)
|
||||
|
||||
# .makeRe globstar
|
||||
micromatch x 1,393,992 ops/sec ±0.71% (89 runs sampled)
|
||||
minimatch x 1,112,801 ops/sec ±2.02% (91 runs sampled)
|
||||
micromatch x 1,624,179 ops/sec ±2.22% (91 runs sampled)
|
||||
minimatch x 1,117,230 ops/sec ±2.78% (86 runs sampled))
|
||||
|
||||
# .makeRe globstars
|
||||
micromatch x 1,419,097 ops/sec ±0.34% (94 runs sampled)
|
||||
minimatch x 541,207 ops/sec ±1.66% (93 runs sampled)
|
||||
micromatch x 1,658,642 ops/sec ±0.86% (92 runs sampled)
|
||||
minimatch x 741,224 ops/sec ±1.24% (89 runs sampled))
|
||||
|
||||
# .makeRe with leading star
|
||||
micromatch x 1,247,825 ops/sec ±0.97% (94 runs sampled)
|
||||
minimatch x 489,660 ops/sec ±0.63% (94 runs sampled)
|
||||
micromatch x 1,525,014 ops/sec ±1.63% (90 runs sampled)
|
||||
minimatch x 561,074 ops/sec ±3.07% (89 runs sampled)
|
||||
|
||||
# .makeRe - braces
|
||||
micromatch x 206,301 ops/sec ±1.62% (81 runs sampled))
|
||||
minimatch x 115,986 ops/sec ±0.59% (94 runs sampled)
|
||||
micromatch x 172,478 ops/sec ±2.37% (78 runs sampled)
|
||||
minimatch x 96,087 ops/sec ±2.34% (88 runs sampled)))
|
||||
|
||||
# .makeRe braces - range (expanded)
|
||||
micromatch x 27,782 ops/sec ±0.79% (88 runs sampled)
|
||||
minimatch x 4,683 ops/sec ±1.20% (92 runs sampled)
|
||||
micromatch x 26,973 ops/sec ±0.84% (89 runs sampled)
|
||||
minimatch x 3,023 ops/sec ±0.99% (90 runs sampled))
|
||||
|
||||
# .makeRe braces - range (compiled)
|
||||
micromatch x 134,056 ops/sec ±2.73% (77 runs sampled))
|
||||
minimatch x 977 ops/sec ±0.85% (91 runs sampled)d)
|
||||
micromatch x 152,892 ops/sec ±1.67% (83 runs sampled)
|
||||
minimatch x 992 ops/sec ±3.50% (89 runs sampled)d))
|
||||
|
||||
# .makeRe braces - nested ranges (expanded)
|
||||
micromatch x 18,353 ops/sec ±0.95% (91 runs sampled)
|
||||
minimatch x 4,514 ops/sec ±1.04% (93 runs sampled)
|
||||
micromatch x 15,816 ops/sec ±13.05% (80 runs sampled)
|
||||
minimatch x 2,953 ops/sec ±1.64% (91 runs sampled)
|
||||
|
||||
# .makeRe braces - nested ranges (compiled)
|
||||
micromatch x 38,916 ops/sec ±1.85% (82 runs sampled)
|
||||
minimatch x 980 ops/sec ±0.54% (93 runs sampled)d)
|
||||
micromatch x 110,881 ops/sec ±1.85% (82 runs sampled)
|
||||
minimatch x 1,008 ops/sec ±1.51% (91 runs sampled)
|
||||
|
||||
# .makeRe braces - set (compiled)
|
||||
micromatch x 141,088 ops/sec ±1.70% (70 runs sampled))
|
||||
minimatch x 43,385 ops/sec ±0.87% (93 runs sampled)
|
||||
micromatch x 134,930 ops/sec ±3.54% (63 runs sampled))
|
||||
minimatch x 43,242 ops/sec ±0.60% (93 runs sampled)
|
||||
|
||||
# .makeRe braces - nested sets (compiled)
|
||||
micromatch x 87,272 ops/sec ±2.85% (71 runs sampled))
|
||||
minimatch x 25,327 ops/sec ±1.59% (86 runs sampled)
|
||||
micromatch x 94,455 ops/sec ±1.74% (69 runs sampled))
|
||||
minimatch x 27,720 ops/sec ±1.84% (93 runs sampled))
|
||||
```
|
||||
|
||||
## Contributing
|
||||
@@ -964,23 +963,35 @@ You might also be interested in these projects:
|
||||
|
||||
| **Commits** | **Contributor** |
|
||||
| --- | --- |
|
||||
| 475 | [jonschlinkert](https://github.com/jonschlinkert) |
|
||||
| 512 | [jonschlinkert](https://github.com/jonschlinkert) |
|
||||
| 12 | [es128](https://github.com/es128) |
|
||||
| 9 | [danez](https://github.com/danez) |
|
||||
| 8 | [doowb](https://github.com/doowb) |
|
||||
| 3 | [paulmillr](https://github.com/paulmillr) |
|
||||
| 6 | [paulmillr](https://github.com/paulmillr) |
|
||||
| 5 | [mrmlnc](https://github.com/mrmlnc) |
|
||||
| 3 | [DrPizza](https://github.com/DrPizza) |
|
||||
| 2 | [TrySound](https://github.com/TrySound) |
|
||||
| 2 | [mceIdo](https://github.com/mceIdo) |
|
||||
| 2 | [Glazy](https://github.com/Glazy) |
|
||||
| 2 | [MartinKolarik](https://github.com/MartinKolarik) |
|
||||
| 2 | [antonyk](https://github.com/antonyk) |
|
||||
| 2 | [Tvrqvoise](https://github.com/Tvrqvoise) |
|
||||
| 2 | [tunnckoCore](https://github.com/tunnckoCore) |
|
||||
| 1 | [amilajack](https://github.com/amilajack) |
|
||||
| 1 | [mrmlnc](https://github.com/mrmlnc) |
|
||||
| 1 | [Cslove](https://github.com/Cslove) |
|
||||
| 1 | [devongovett](https://github.com/devongovett) |
|
||||
| 1 | [DianeLooney](https://github.com/DianeLooney) |
|
||||
| 1 | [UltCombo](https://github.com/UltCombo) |
|
||||
| 1 | [frangio](https://github.com/frangio) |
|
||||
| 1 | [joyceerhl](https://github.com/joyceerhl) |
|
||||
| 1 | [juszczykjakub](https://github.com/juszczykjakub) |
|
||||
| 1 | [muescha](https://github.com/muescha) |
|
||||
| 1 | [sebdeckers](https://github.com/sebdeckers) |
|
||||
| 1 | [tomByrer](https://github.com/tomByrer) |
|
||||
| 1 | [fidian](https://github.com/fidian) |
|
||||
| 1 | [curbengh](https://github.com/curbengh) |
|
||||
| 1 | [simlu](https://github.com/simlu) |
|
||||
| 1 | [wtgtybhertgeghgtwtg](https://github.com/wtgtybhertgeghgtwtg) |
|
||||
| 1 | [yvele](https://github.com/yvele) |
|
||||
|
||||
### Author
|
||||
|
||||
@@ -992,9 +1003,9 @@ You might also be interested in these projects:
|
||||
|
||||
### License
|
||||
|
||||
Copyright © 2019, [Jon Schlinkert](https://github.com/jonschlinkert).
|
||||
Copyright © 2022, [Jon Schlinkert](https://github.com/jonschlinkert).
|
||||
Released under the [MIT License](LICENSE).
|
||||
|
||||
***
|
||||
|
||||
_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on April 10, 2019._
|
||||
_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on March 24, 2022._
|
||||
+14
-14
@@ -4,7 +4,7 @@ const util = require('util');
|
||||
const braces = require('braces');
|
||||
const picomatch = require('picomatch');
|
||||
const utils = require('picomatch/lib/utils');
|
||||
const isEmptyString = val => typeof val === 'string' && (val === '' || val === './');
|
||||
const isEmptyString = val => val === '' || val === './';
|
||||
|
||||
/**
|
||||
* Returns an array of strings that match one or more glob patterns.
|
||||
@@ -16,9 +16,9 @@ const isEmptyString = val => typeof val === 'string' && (val === '' || val === '
|
||||
* console.log(mm(['a.js', 'a.txt'], ['*.js']));
|
||||
* //=> [ 'a.js' ]
|
||||
* ```
|
||||
* @param {String|Array<string>} list List of strings to match.
|
||||
* @param {String|Array<string>} patterns One or more glob patterns to use for matching.
|
||||
* @param {Object} options See available [options](#options)
|
||||
* @param {String|Array<string>} `list` List of strings to match.
|
||||
* @param {String|Array<string>} `patterns` One or more glob patterns to use for matching.
|
||||
* @param {Object} `options` See available [options](#options)
|
||||
* @return {Array} Returns an array of matches
|
||||
* @summary false
|
||||
* @api public
|
||||
@@ -113,9 +113,9 @@ micromatch.matcher = (pattern, options) => picomatch(pattern, options);
|
||||
* console.log(mm.isMatch('a.a', ['b.*', '*.a'])); //=> true
|
||||
* console.log(mm.isMatch('a.a', 'b.*')); //=> false
|
||||
* ```
|
||||
* @param {String} str The string to test.
|
||||
* @param {String|Array} patterns One or more glob patterns to use for matching.
|
||||
* @param {Object} [options] See available [options](#options).
|
||||
* @param {String} `str` The string to test.
|
||||
* @param {String|Array} `patterns` One or more glob patterns to use for matching.
|
||||
* @param {Object} `[options]` See available [options](#options).
|
||||
* @return {Boolean} Returns true if any patterns match `str`
|
||||
* @api public
|
||||
*/
|
||||
@@ -155,10 +155,10 @@ micromatch.not = (list, patterns, options = {}) => {
|
||||
items.push(state.output);
|
||||
};
|
||||
|
||||
let matches = micromatch(list, patterns, { ...options, onResult });
|
||||
let matches = new Set(micromatch(list, patterns, { ...options, onResult }));
|
||||
|
||||
for (let item of items) {
|
||||
if (!matches.includes(item)) {
|
||||
if (!matches.has(item)) {
|
||||
result.add(item);
|
||||
}
|
||||
}
|
||||
@@ -181,7 +181,7 @@ micromatch.not = (list, patterns, options = {}) => {
|
||||
* @param {String} `str` The string to match.
|
||||
* @param {String|Array} `patterns` Glob pattern to use for matching.
|
||||
* @param {Object} `options` See available [options](#options) for changing how matches are performed
|
||||
* @return {Boolean} Returns true if the patter matches any part of `str`.
|
||||
* @return {Boolean} Returns true if any of the patterns matches any part of `str`.
|
||||
* @api public
|
||||
*/
|
||||
|
||||
@@ -252,7 +252,7 @@ micromatch.matchKeys = (obj, patterns, options) => {
|
||||
* @param {String|Array} `list` The string or array of strings to test. Returns as soon as the first match is found.
|
||||
* @param {String|Array} `patterns` One or more glob patterns to use for matching.
|
||||
* @param {Object} `options` See available [options](#options) for changing how matches are performed
|
||||
* @return {Boolean} Returns true if any patterns match `str`
|
||||
* @return {Boolean} Returns true if any `patterns` matches any of the strings in `list`
|
||||
* @api public
|
||||
*/
|
||||
|
||||
@@ -288,7 +288,7 @@ micromatch.some = (list, patterns, options) => {
|
||||
* @param {String|Array} `list` The string or array of strings to test.
|
||||
* @param {String|Array} `patterns` One or more glob patterns to use for matching.
|
||||
* @param {Object} `options` See available [options](#options) for changing how matches are performed
|
||||
* @return {Boolean} Returns true if any patterns match `str`
|
||||
* @return {Boolean} Returns true if all `patterns` matches all of the strings in `list`
|
||||
* @api public
|
||||
*/
|
||||
|
||||
@@ -354,7 +354,7 @@ micromatch.all = (str, patterns, options) => {
|
||||
* @param {String} `glob` Glob pattern to use for matching.
|
||||
* @param {String} `input` String to match
|
||||
* @param {Object} `options` See available [options](#options) for changing how matches are performed
|
||||
* @return {Boolean} Returns an array of captures if the input matches the glob pattern, otherwise `null`.
|
||||
* @return {Array|null} Returns an array of captures if the input matches the glob pattern, otherwise `null`.
|
||||
* @api public
|
||||
*/
|
||||
|
||||
@@ -408,7 +408,7 @@ micromatch.scan = (...args) => picomatch.scan(...args);
|
||||
*
|
||||
* ```js
|
||||
* const mm = require('micromatch');
|
||||
* const state = mm(pattern[, options]);
|
||||
* const state = mm.parse(pattern[, options]);
|
||||
* ```
|
||||
* @param {String} `glob`
|
||||
* @param {Object} `options`
|
||||
|
||||
+21
-17
@@ -1,34 +1,34 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"micromatch@4.0.2",
|
||||
"/mnt/Foxconn/Digitalent/Deverloper/liff-push_2series"
|
||||
"micromatch@4.0.5",
|
||||
"/home/node/nuxt"
|
||||
]
|
||||
],
|
||||
"_from": "micromatch@4.0.2",
|
||||
"_id": "micromatch@4.0.2",
|
||||
"_from": "micromatch@4.0.5",
|
||||
"_id": "micromatch@4.0.5",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==",
|
||||
"_integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==",
|
||||
"_location": "/micromatch",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "micromatch@4.0.2",
|
||||
"raw": "micromatch@4.0.5",
|
||||
"name": "micromatch",
|
||||
"escapedName": "micromatch",
|
||||
"rawSpec": "4.0.2",
|
||||
"rawSpec": "4.0.5",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "4.0.2"
|
||||
"fetchSpec": "4.0.5"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/fast-glob",
|
||||
"/http-proxy-middleware",
|
||||
"/ts-loader"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz",
|
||||
"_spec": "4.0.2",
|
||||
"_where": "/mnt/Foxconn/Digitalent/Deverloper/liff-push_2series",
|
||||
"_resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz",
|
||||
"_spec": "4.0.5",
|
||||
"_where": "/home/node/nuxt",
|
||||
"author": {
|
||||
"name": "Jon Schlinkert",
|
||||
"url": "https://github.com/jonschlinkert"
|
||||
@@ -92,22 +92,26 @@
|
||||
"name": "Peter Bright",
|
||||
"email": "drpizza@quiscalusmexicanus.org",
|
||||
"url": "https://github.com/drpizza"
|
||||
},
|
||||
{
|
||||
"name": "Kuba Juszczyk",
|
||||
"url": "https://github.com/ku8ar"
|
||||
}
|
||||
],
|
||||
"dependencies": {
|
||||
"braces": "^3.0.1",
|
||||
"picomatch": "^2.0.5"
|
||||
"braces": "^3.0.2",
|
||||
"picomatch": "^2.3.1"
|
||||
},
|
||||
"description": "Glob matching for javascript/node.js. A replacement and faster alternative to minimatch and multimatch.",
|
||||
"devDependencies": {
|
||||
"fill-range": "^7.0.1",
|
||||
"gulp-format-md": "^2.0.0",
|
||||
"minimatch": "^3.0.4",
|
||||
"mocha": "^5.2.0",
|
||||
"minimatch": "^5.0.1",
|
||||
"mocha": "^9.2.2",
|
||||
"time-require": "github:jonschlinkert/time-require"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
"node": ">=8.6"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
@@ -192,5 +196,5 @@
|
||||
"multimatch"
|
||||
]
|
||||
},
|
||||
"version": "4.0.2"
|
||||
"version": "4.0.5"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user