micromatch 4.0.0 → 4.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of micromatch might be problematic. Click here for more details.

package/CHANGELOG.md CHANGED
@@ -43,8 +43,9 @@ Changelog entries are classified using the following labels _(from [keep-a-chang
43
43
 
44
44
  ### Breaking changes
45
45
 
46
+ - Require Node.js >= 8.6
46
47
  - Removed support for passing an array of brace patterns to `micromatch.braces()`.
47
- - To strictly enforce closing brackets (for `{`, `[`, and `(`), you must now use `strictBrackets=true` instead of `strictErrors`.
48
+ - To strictly enforce closing brackets (for `{`, `[`, and `(`), you must now use `strictBrackets=true` instead of `strictErrors`.
48
49
  - `cache` - caching and all related options and methods have been removed
49
50
  - `options.unixify` was renamed to `options.windows`
50
51
  - `options.nodupes` Was removed. Duplicates are always removed by default. You can override this with custom behavior by using the `onMatch`, `onResult` and `onIgnore` functions.
@@ -72,7 +73,7 @@ Here are those sub-modules with links to related prs on those modules if you wan
72
73
 
73
74
  **Added**
74
75
 
75
- - source map support (optionally created when using parse or compile - I have no idea what the use case is yet, but they come for free) (note that source maps are not generated for brace expansion at present, since the braces compiler uses a different strategy. I'll update if/when this changes).
76
+ - source map support (optionally created when using parse or compile - I have no idea what the use case is yet, but they come for free) (note that source maps are not generated for brace expansion at present, since the braces compiler uses a different strategy. I'll update if/when this changes).
76
77
  - parser is exposed, so that implementors can customize or override specific micromatch parsers if necessary
77
78
  - compiler is exposed, so that implementors can customize or override specific micromatch compilers if necessary
78
79
 
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # micromatch [![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=W8YFZ425KND68) [![NPM version](https://img.shields.io/npm/v/micromatch.svg?style=flat)](https://www.npmjs.com/package/micromatch) [![NPM monthly downloads](https://img.shields.io/npm/dm/micromatch.svg?style=flat)](https://npmjs.org/package/micromatch) [![NPM total downloads](https://img.shields.io/npm/dt/micromatch.svg?style=flat)](https://npmjs.org/package/micromatch) [![Linux Build Status](https://img.shields.io/travis/micromatch/micromatch.svg?style=flat&label=Travis)](https://travis-ci.org/micromatch/micromatch)
1
+ # micromatch [![NPM version](https://img.shields.io/npm/v/micromatch.svg?style=flat)](https://www.npmjs.com/package/micromatch) [![NPM monthly downloads](https://img.shields.io/npm/dm/micromatch.svg?style=flat)](https://npmjs.org/package/micromatch) [![NPM total downloads](https://img.shields.io/npm/dt/micromatch.svg?style=flat)](https://npmjs.org/package/micromatch) [![Linux Build Status](https://img.shields.io/travis/micromatch/micromatch.svg?style=flat&label=Travis)](https://travis-ci.org/micromatch/micromatch)
2
2
 
3
3
  > Glob matching for javascript/node.js. A replacement and faster alternative to minimatch and multimatch.
4
4
 
@@ -93,7 +93,7 @@ console.log(micromatch.isMatch('foo', ['b*', 'f*'])) //=> true
93
93
  * 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.
94
94
  * **Fast & Performant** - Loads in about 5ms and performs [fast matches](#benchmarks).
95
95
  * **Glob matching** - Using wildcards (`*` and `?`), globstars (`**`) for nested directories
96
- * **[Advanced globbing](#advanced-globbing)** - Supports [extglobs](#extglobs), [braces](#braces), and [POSIX brackets](#posix-bracket-expressions), and support for escaping special characters with `\` or quotes.
96
+ * **[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.
97
97
  * **Accurate** - Covers more scenarios [than minimatch](https://github.com/yarnpkg/yarn/pull/3339)
98
98
  * **Well tested** - More than 5,000 [test assertions](./test)
99
99
  * **Windows support** - More reliable windows support than minimatch and multimatch.
@@ -142,9 +142,9 @@ console.log(micromatch(['foo', 'bar', 'baz'], ['f*', '*z'])); //=> ['foo', 'baz'
142
142
 
143
143
  **Params**
144
144
 
145
- * **{String|Array<string>}**: list List of strings to match.
146
- * **{String|Array<string>}**: patterns One or more glob patterns to use for matching.
147
- * **{Object}**: options See available [options](#options)
145
+ * `list` **{String|Array<string>}**: List of strings to match.
146
+ * `patterns` **{String|Array<string>}**: One or more glob patterns to use for matching.
147
+ * `options` **{Object}**: See available [options](#options)
148
148
  * `returns` **{Array}**: Returns an array of matches
149
149
 
150
150
  **Example**
@@ -157,7 +157,7 @@ console.log(mm(['a.js', 'a.txt'], ['*.js']));
157
157
  //=> [ 'a.js' ]
158
158
  ```
159
159
 
160
- ### [.matcher](index.js#L98)
160
+ ### [.matcher](index.js#L104)
161
161
 
162
162
  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.
163
163
 
@@ -178,15 +178,15 @@ console.log(isMatch('a.a')); //=> false
178
178
  console.log(isMatch('a.b')); //=> true
179
179
  ```
180
180
 
181
- ### [.isMatch](index.js#L117)
181
+ ### [.isMatch](index.js#L123)
182
182
 
183
183
  Returns true if **any** of the given glob `patterns` match the specified `string`.
184
184
 
185
185
  **Params**
186
186
 
187
- * **{String}**: str The string to test.
188
- * **{String|Array}**: patterns One or more glob patterns to use for matching.
189
- * **{Object}**: See available [options](#options).
187
+ * `str` **{String}**: The string to test.
188
+ * `patterns` **{String|Array}**: One or more glob patterns to use for matching.
189
+ * `[options]` **{Object}**: See available [options](#options).
190
190
  * `returns` **{Boolean}**: Returns true if any patterns match `str`
191
191
 
192
192
  **Example**
@@ -199,7 +199,7 @@ console.log(mm.isMatch('a.a', ['b.*', '*.a'])); //=> true
199
199
  console.log(mm.isMatch('a.a', 'b.*')); //=> false
200
200
  ```
201
201
 
202
- ### [.not](index.js#L136)
202
+ ### [.not](index.js#L148)
203
203
 
204
204
  Returns a list of strings that _**do not match any**_ of the given `patterns`.
205
205
 
@@ -220,7 +220,7 @@ console.log(mm.not(['a.a', 'b.b', 'c.c'], '*.a'));
220
220
  //=> ['b.b', 'c.c']
221
221
  ```
222
222
 
223
- ### [.contains](index.js#L176)
223
+ ### [.contains](index.js#L188)
224
224
 
225
225
  Returns true if the given `string` contains the given pattern. Similar to [.isMatch](#isMatch) but the pattern can match any part of the string.
226
226
 
@@ -229,7 +229,7 @@ Returns true if the given `string` contains the given pattern. Similar to [.isMa
229
229
  * `str` **{String}**: The string to match.
230
230
  * `patterns` **{String|Array}**: Glob pattern to use for matching.
231
231
  * `options` **{Object}**: See available [options](#options) for changing how matches are performed
232
- * `returns` **{Boolean}**: Returns true if the patter matches any part of `str`.
232
+ * `returns` **{Boolean}**: Returns true if any of the patterns matches any part of `str`.
233
233
 
234
234
  **Example**
235
235
 
@@ -243,7 +243,7 @@ console.log(mm.contains('aa/bb/cc', '*d'));
243
243
  //=> false
244
244
  ```
245
245
 
246
- ### [.matchKeys](index.js#L218)
246
+ ### [.matchKeys](index.js#L230)
247
247
 
248
248
  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.
249
249
 
@@ -265,7 +265,7 @@ console.log(mm.matchKeys(obj, '*b'));
265
265
  //=> { ab: 'b' }
266
266
  ```
267
267
 
268
- ### [.some](index.js#L247)
268
+ ### [.some](index.js#L259)
269
269
 
270
270
  Returns true if some of the strings in the given `list` match any of the given glob `patterns`.
271
271
 
@@ -274,7 +274,7 @@ Returns true if some of the strings in the given `list` match any of the given g
274
274
  * `list` **{String|Array}**: The string or array of strings to test. Returns as soon as the first match is found.
275
275
  * `patterns` **{String|Array}**: One or more glob patterns to use for matching.
276
276
  * `options` **{Object}**: See available [options](#options) for changing how matches are performed
277
- * `returns` **{Boolean}**: Returns true if any patterns match `str`
277
+ * `returns` **{Boolean}**: Returns true if any `patterns` matches any of the strings in `list`
278
278
 
279
279
  **Example**
280
280
 
@@ -288,7 +288,7 @@ console.log(mm.some(['foo.js'], ['*.js', '!foo.js']));
288
288
  // false
289
289
  ```
290
290
 
291
- ### [.every](index.js#L283)
291
+ ### [.every](index.js#L295)
292
292
 
293
293
  Returns true if every string in the given `list` matches any of the given glob `patterns`.
294
294
 
@@ -297,7 +297,7 @@ Returns true if every string in the given `list` matches any of the given glob `
297
297
  * `list` **{String|Array}**: The string or array of strings to test.
298
298
  * `patterns` **{String|Array}**: One or more glob patterns to use for matching.
299
299
  * `options` **{Object}**: See available [options](#options) for changing how matches are performed
300
- * `returns` **{Boolean}**: Returns true if any patterns match `str`
300
+ * `returns` **{Boolean}**: Returns true if all `patterns` matches all of the strings in `list`
301
301
 
302
302
  **Example**
303
303
 
@@ -315,7 +315,7 @@ console.log(mm.every(['foo.js'], ['*.js', '!foo.js']));
315
315
  // false
316
316
  ```
317
317
 
318
- ### [.all](index.js#L322)
318
+ ### [.all](index.js#L334)
319
319
 
320
320
  Returns true if **all** of the given `patterns` match the specified string.
321
321
 
@@ -345,7 +345,7 @@ console.log(mm.all('foo.js', ['*.js', 'f*', '*o*', '*o.js']));
345
345
  // true
346
346
  ```
347
347
 
348
- ### [.capture](index.js#L349)
348
+ ### [.capture](index.js#L361)
349
349
 
350
350
  Returns an array of matches captured by `pattern` in `string, or`null` if the pattern did not match.
351
351
 
@@ -354,7 +354,7 @@ Returns an array of matches captured by `pattern` in `string, or`null` if the pa
354
354
  * `glob` **{String}**: Glob pattern to use for matching.
355
355
  * `input` **{String}**: String to match
356
356
  * `options` **{Object}**: See available [options](#options) for changing how matches are performed
357
- * `returns` **{Boolean}**: Returns an array of captures if the input matches the glob pattern, otherwise `null`.
357
+ * `returns` **{Array|null}**: Returns an array of captures if the input matches the glob pattern, otherwise `null`.
358
358
 
359
359
  **Example**
360
360
 
@@ -368,7 +368,7 @@ console.log(mm.capture('test/*.js', 'foo/bar.css'));
368
368
  //=> null
369
369
  ```
370
370
 
371
- ### [.makeRe](index.js#L375)
371
+ ### [.makeRe](index.js#L387)
372
372
 
373
373
  Create a regular expression from the given glob `pattern`.
374
374
 
@@ -388,7 +388,7 @@ console.log(mm.makeRe('*.js'));
388
388
  //=> /^(?:(\.[\\\/])?(?!\.)(?=.)[^\/]*?\.js)$/
389
389
  ```
390
390
 
391
- ### [.scan](index.js#L391)
391
+ ### [.scan](index.js#L403)
392
392
 
393
393
  Scan a glob pattern to separate the pattern into segments. Used by the [split](#split) method.
394
394
 
@@ -405,7 +405,7 @@ const mm = require('micromatch');
405
405
  const state = mm.scan(pattern[, options]);
406
406
  ```
407
407
 
408
- ### [.parse](index.js#L407)
408
+ ### [.parse](index.js#L419)
409
409
 
410
410
  Parse a glob pattern to create the source string for a regular expression.
411
411
 
@@ -422,7 +422,7 @@ const mm = require('micromatch');
422
422
  const state = mm(pattern[, options]);
423
423
  ```
424
424
 
425
- ### [.braces](index.js#L434)
425
+ ### [.braces](index.js#L446)
426
426
 
427
427
  Process the given brace `pattern`.
428
428
 
@@ -479,7 +479,7 @@ console.log(braces('foo/{a,b,c}/bar', { expand: true }));
479
479
  | [onResult](#optionsonResult) | `function` | `undefined` | Function to be called on all items, regardless of whether or not they are matched or ignored. |
480
480
  | `posix` | `boolean` | `false` | Support [POSIX character classes](#posix-bracket-expressions) ("posix brackets"). |
481
481
  | `posixSlashes` | `boolean` | `undefined` | Convert all slashes in file paths to forward slashes. This does not convert slashes in the glob pattern itself |
482
- | `prepend` | `boolean` | `undefined` | String to prepend to the generated regex used for matching. |
482
+ | `prepend` | `string` | `undefined` | String to prepend to the generated regex used for matching. |
483
483
  | `regex` | `boolean` | `false` | Use regular expression rules for `+` (instead of matching literal `+`), and for stars that follow closing parentheses or brackets (as in `)*` and `]*`). |
484
484
  | `strictBrackets` | `boolean` | `undefined` | Throw an error if brackets, braces, or parens are imbalanced. |
485
485
  | `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']`:
772
772
 
773
773
  * `[ac].js`: matches both `a` and `c`, returning `['a.js', 'c.js']`
774
774
  * `[b-d].js`: matches from `b` to `d`, returning `['b.js', 'c.js', 'd.js']`
775
- * `[b-d].js`: matches from `b` to `d`, returning `['b.js', 'c.js', 'd.js']`
776
775
  * `a/[A-Z].js`: matches and uppercase letter, returning `['a/E.md']`
777
776
 
778
777
  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(/\\/
835
834
  Install dependencies for running benchmarks:
836
835
 
837
836
  ```sh
838
- $ cd bench && npm install
837
+ $ cd bench && npm install
839
838
  ```
840
839
 
841
840
  Run the benchmarks:
@@ -846,56 +845,56 @@ $ npm run bench
846
845
 
847
846
  ### Latest results
848
847
 
849
- As of April 10, 2019 (longer bars are better):
848
+ As of April 10, 2021 (longer bars are better):
850
849
 
851
850
  ```sh
852
851
  # .makeRe star
853
- micromatch x 1,724,735 ops/sec ±1.69% (87 runs sampled))
854
- minimatch x 649,565 ops/sec ±1.93% (91 runs sampled)
852
+ micromatch x 2,232,802 ops/sec ±2.34% (89 runs sampled))
853
+ minimatch x 781,018 ops/sec ±6.74% (92 runs sampled))
855
854
 
856
855
  # .makeRe star; dot=true
857
- micromatch x 1,302,127 ops/sec ±1.43% (92 runs sampled)
858
- minimatch x 556,242 ops/sec ±0.71% (86 runs sampled)
856
+ micromatch x 1,863,453 ops/sec ±0.74% (93 runs sampled)
857
+ minimatch x 723,105 ops/sec ±0.75% (93 runs sampled)
859
858
 
860
859
  # .makeRe globstar
861
- micromatch x 1,393,992 ops/sec ±0.71% (89 runs sampled)
862
- minimatch x 1,112,801 ops/sec ±2.02% (91 runs sampled)
860
+ micromatch x 1,624,179 ops/sec ±2.22% (91 runs sampled)
861
+ minimatch x 1,117,230 ops/sec ±2.78% (86 runs sampled))
863
862
 
864
863
  # .makeRe globstars
865
- micromatch x 1,419,097 ops/sec ±0.34% (94 runs sampled)
866
- minimatch x 541,207 ops/sec ±1.66% (93 runs sampled)
864
+ micromatch x 1,658,642 ops/sec ±0.86% (92 runs sampled)
865
+ minimatch x 741,224 ops/sec ±1.24% (89 runs sampled))
867
866
 
868
867
  # .makeRe with leading star
869
- micromatch x 1,247,825 ops/sec ±0.97% (94 runs sampled)
870
- minimatch x 489,660 ops/sec ±0.63% (94 runs sampled)
868
+ micromatch x 1,525,014 ops/sec ±1.63% (90 runs sampled)
869
+ minimatch x 561,074 ops/sec ±3.07% (89 runs sampled)
871
870
 
872
871
  # .makeRe - braces
873
- micromatch x 206,301 ops/sec ±1.62% (81 runs sampled))
874
- minimatch x 115,986 ops/sec ±0.59% (94 runs sampled)
872
+ micromatch x 172,478 ops/sec ±2.37% (78 runs sampled)
873
+ minimatch x 96,087 ops/sec ±2.34% (88 runs sampled)))
875
874
 
876
875
  # .makeRe braces - range (expanded)
877
- micromatch x 27,782 ops/sec ±0.79% (88 runs sampled)
878
- minimatch x 4,683 ops/sec ±1.20% (92 runs sampled)
876
+ micromatch x 26,973 ops/sec ±0.84% (89 runs sampled)
877
+ minimatch x 3,023 ops/sec ±0.99% (90 runs sampled))
879
878
 
880
879
  # .makeRe braces - range (compiled)
881
- micromatch x 134,056 ops/sec ±2.73% (77 runs sampled))
882
- minimatch x 977 ops/sec ±0.85% (91 runs sampled)d)
880
+ micromatch x 152,892 ops/sec ±1.67% (83 runs sampled)
881
+ minimatch x 992 ops/sec ±3.50% (89 runs sampled)d))
883
882
 
884
883
  # .makeRe braces - nested ranges (expanded)
885
- micromatch x 18,353 ops/sec ±0.95% (91 runs sampled)
886
- minimatch x 4,514 ops/sec ±1.04% (93 runs sampled)
884
+ micromatch x 15,816 ops/sec ±13.05% (80 runs sampled)
885
+ minimatch x 2,953 ops/sec ±1.64% (91 runs sampled)
887
886
 
888
887
  # .makeRe braces - nested ranges (compiled)
889
- micromatch x 38,916 ops/sec ±1.85% (82 runs sampled)
890
- minimatch x 980 ops/sec ±0.54% (93 runs sampled)d)
888
+ micromatch x 110,881 ops/sec ±1.85% (82 runs sampled)
889
+ minimatch x 1,008 ops/sec ±1.51% (91 runs sampled)
891
890
 
892
891
  # .makeRe braces - set (compiled)
893
- micromatch x 141,088 ops/sec ±1.70% (70 runs sampled))
894
- minimatch x 43,385 ops/sec ±0.87% (93 runs sampled)
892
+ micromatch x 134,930 ops/sec ±3.54% (63 runs sampled))
893
+ minimatch x 43,242 ops/sec ±0.60% (93 runs sampled)
895
894
 
896
895
  # .makeRe braces - nested sets (compiled)
897
- micromatch x 87,272 ops/sec ±2.85% (71 runs sampled))
898
- minimatch x 25,327 ops/sec ±1.59% (86 runs sampled)
896
+ micromatch x 94,455 ops/sec ±1.74% (69 runs sampled))
897
+ minimatch x 27,720 ops/sec ±1.84% (93 runs sampled))
899
898
  ```
900
899
 
901
900
  ## Contributing
@@ -964,23 +963,32 @@ You might also be interested in these projects:
964
963
 
965
964
  | **Commits** | **Contributor** |
966
965
  | --- | --- |
967
- | 475 | [jonschlinkert](https://github.com/jonschlinkert) |
966
+ | 508 | [jonschlinkert](https://github.com/jonschlinkert) |
968
967
  | 12 | [es128](https://github.com/es128) |
969
968
  | 8 | [doowb](https://github.com/doowb) |
970
- | 3 | [paulmillr](https://github.com/paulmillr) |
969
+ | 6 | [paulmillr](https://github.com/paulmillr) |
970
+ | 5 | [mrmlnc](https://github.com/mrmlnc) |
971
+ | 4 | [danez](https://github.com/danez) |
972
+ | 3 | [DrPizza](https://github.com/DrPizza) |
971
973
  | 2 | [TrySound](https://github.com/TrySound) |
974
+ | 2 | [mceIdo](https://github.com/mceIdo) |
975
+ | 2 | [Glazy](https://github.com/Glazy) |
972
976
  | 2 | [MartinKolarik](https://github.com/MartinKolarik) |
973
977
  | 2 | [Tvrqvoise](https://github.com/Tvrqvoise) |
974
- | 2 | [tunnckoCore](https://github.com/tunnckoCore) |
975
978
  | 1 | [amilajack](https://github.com/amilajack) |
976
- | 1 | [mrmlnc](https://github.com/mrmlnc) |
979
+ | 1 | [Cslove](https://github.com/Cslove) |
977
980
  | 1 | [devongovett](https://github.com/devongovett) |
978
981
  | 1 | [DianeLooney](https://github.com/DianeLooney) |
979
982
  | 1 | [UltCombo](https://github.com/UltCombo) |
983
+ | 1 | [frangio](https://github.com/frangio) |
984
+ | 1 | [juszczykjakub](https://github.com/juszczykjakub) |
985
+ | 1 | [muescha](https://github.com/muescha) |
986
+ | 1 | [sebdeckers](https://github.com/sebdeckers) |
980
987
  | 1 | [tomByrer](https://github.com/tomByrer) |
981
988
  | 1 | [fidian](https://github.com/fidian) |
982
989
  | 1 | [simlu](https://github.com/simlu) |
983
990
  | 1 | [wtgtybhertgeghgtwtg](https://github.com/wtgtybhertgeghgtwtg) |
991
+ | 1 | [yvele](https://github.com/yvele) |
984
992
 
985
993
  ### Author
986
994
 
@@ -992,9 +1000,9 @@ You might also be interested in these projects:
992
1000
 
993
1001
  ### License
994
1002
 
995
- Copyright © 2019, [Jon Schlinkert](https://github.com/jonschlinkert).
1003
+ Copyright © 2021, [Jon Schlinkert](https://github.com/jonschlinkert).
996
1004
  Released under the [MIT License](LICENSE).
997
1005
 
998
1006
  ***
999
1007
 
1000
- _This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on April 10, 2019._
1008
+ _This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on April 10, 2021._
package/index.js CHANGED
@@ -4,7 +4,7 @@ const util = require('util');
4
4
  const braces = require('braces');
5
5
  const picomatch = require('picomatch');
6
6
  const utils = require('picomatch/lib/utils');
7
- const isEmptyString = val => typeof val === 'string' && (val === '' || val === './');
7
+ const isEmptyString = val => val === '' || val === './';
8
8
 
9
9
  /**
10
10
  * Returns an array of strings that match one or more glob patterns.
@@ -16,9 +16,9 @@ const isEmptyString = val => typeof val === 'string' && (val === '' || val === '
16
16
  * console.log(mm(['a.js', 'a.txt'], ['*.js']));
17
17
  * //=> [ 'a.js' ]
18
18
  * ```
19
- * @param {String|Array<string>} list List of strings to match.
20
- * @param {String|Array<string>} patterns One or more glob patterns to use for matching.
21
- * @param {Object} options See available [options](#options)
19
+ * @param {String|Array<string>} `list` List of strings to match.
20
+ * @param {String|Array<string>} `patterns` One or more glob patterns to use for matching.
21
+ * @param {Object} `options` See available [options](#options)
22
22
  * @return {Array} Returns an array of matches
23
23
  * @summary false
24
24
  * @api public
@@ -76,6 +76,12 @@ const micromatch = (list, patterns, options) => {
76
76
  return matches;
77
77
  };
78
78
 
79
+ /**
80
+ * Backwards compatibility
81
+ */
82
+
83
+ micromatch.match = micromatch;
84
+
79
85
  /**
80
86
  * Returns a matcher function from the given glob `pattern` and `options`.
81
87
  * The returned function takes a string to match as its only argument and returns
@@ -107,15 +113,21 @@ micromatch.matcher = (pattern, options) => picomatch(pattern, options);
107
113
  * console.log(mm.isMatch('a.a', ['b.*', '*.a'])); //=> true
108
114
  * console.log(mm.isMatch('a.a', 'b.*')); //=> false
109
115
  * ```
110
- * @param {String} str The string to test.
111
- * @param {String|Array} patterns One or more glob patterns to use for matching.
112
- * @param {Object} [options] See available [options](#options).
116
+ * @param {String} `str` The string to test.
117
+ * @param {String|Array} `patterns` One or more glob patterns to use for matching.
118
+ * @param {Object} `[options]` See available [options](#options).
113
119
  * @return {Boolean} Returns true if any patterns match `str`
114
120
  * @api public
115
121
  */
116
122
 
117
123
  micromatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
118
124
 
125
+ /**
126
+ * Backwards compatibility
127
+ */
128
+
129
+ micromatch.any = micromatch.isMatch;
130
+
119
131
  /**
120
132
  * Returns a list of strings that _**do not match any**_ of the given `patterns`.
121
133
  *
@@ -169,7 +181,7 @@ micromatch.not = (list, patterns, options = {}) => {
169
181
  * @param {String} `str` The string to match.
170
182
  * @param {String|Array} `patterns` Glob pattern to use for matching.
171
183
  * @param {Object} `options` See available [options](#options) for changing how matches are performed
172
- * @return {Boolean} Returns true if the patter matches any part of `str`.
184
+ * @return {Boolean} Returns true if any of the patterns matches any part of `str`.
173
185
  * @api public
174
186
  */
175
187
 
@@ -240,7 +252,7 @@ micromatch.matchKeys = (obj, patterns, options) => {
240
252
  * @param {String|Array} `list` The string or array of strings to test. Returns as soon as the first match is found.
241
253
  * @param {String|Array} `patterns` One or more glob patterns to use for matching.
242
254
  * @param {Object} `options` See available [options](#options) for changing how matches are performed
243
- * @return {Boolean} Returns true if any patterns match `str`
255
+ * @return {Boolean} Returns true if any `patterns` matches any of the strings in `list`
244
256
  * @api public
245
257
  */
246
258
 
@@ -276,7 +288,7 @@ micromatch.some = (list, patterns, options) => {
276
288
  * @param {String|Array} `list` The string or array of strings to test.
277
289
  * @param {String|Array} `patterns` One or more glob patterns to use for matching.
278
290
  * @param {Object} `options` See available [options](#options) for changing how matches are performed
279
- * @return {Boolean} Returns true if any patterns match `str`
291
+ * @return {Boolean} Returns true if all `patterns` matches all of the strings in `list`
280
292
  * @api public
281
293
  */
282
294
 
@@ -342,7 +354,7 @@ micromatch.all = (str, patterns, options) => {
342
354
  * @param {String} `glob` Glob pattern to use for matching.
343
355
  * @param {String} `input` String to match
344
356
  * @param {Object} `options` See available [options](#options) for changing how matches are performed
345
- * @return {Boolean} Returns an array of captures if the input matches the glob pattern, otherwise `null`.
357
+ * @return {Array|null} Returns an array of captures if the input matches the glob pattern, otherwise `null`.
346
358
  * @api public
347
359
  */
348
360
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "micromatch",
3
3
  "description": "Glob matching for javascript/node.js. A replacement and faster alternative to minimatch and multimatch.",
4
- "version": "4.0.0",
4
+ "version": "4.0.4",
5
5
  "homepage": "https://github.com/micromatch/micromatch",
6
6
  "author": "Jon Schlinkert (https://github.com/jonschlinkert)",
7
7
  "contributors": [
@@ -17,7 +17,9 @@
17
17
  "Olsten Larck (https://i.am.charlike.online)",
18
18
  "Paul Miller (paulmillr.com)",
19
19
  "Tom Byrer (https://github.com/tomByrer)",
20
- "Tyler Akins (http://rumkin.com)"
20
+ "Tyler Akins (http://rumkin.com)",
21
+ "Peter Bright <drpizza@quiscalusmexicanus.org> (https://github.com/drpizza)",
22
+ "Kuba Juszczyk (https://github.com/ku8ar)"
21
23
  ],
22
24
  "repository": "micromatch/micromatch",
23
25
  "bugs": {
@@ -29,20 +31,20 @@
29
31
  ],
30
32
  "main": "index.js",
31
33
  "engines": {
32
- "node": ">=8"
34
+ "node": ">=8.6"
33
35
  },
34
36
  "scripts": {
35
37
  "test": "mocha"
36
38
  },
37
39
  "dependencies": {
38
40
  "braces": "^3.0.1",
39
- "picomatch": "^2.0.3"
41
+ "picomatch": "^2.2.3"
40
42
  },
41
43
  "devDependencies": {
42
44
  "fill-range": "^7.0.1",
43
45
  "gulp-format-md": "^2.0.0",
44
46
  "minimatch": "^3.0.4",
45
- "mocha": "^5.2.0",
47
+ "mocha": "^7.2.0",
46
48
  "time-require": "github:jonschlinkert/time-require"
47
49
  },
48
50
  "keywords": [