micromatch 4.0.7 → 4.0.8

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.
Files changed (3) hide show
  1. package/README.md +106 -99
  2. package/index.js +9 -2
  3. package/package.json +24 -6
package/README.md CHANGED
@@ -56,7 +56,7 @@ Please consider following this project's author, [Jon Schlinkert](https://github
56
56
 
57
57
  ## Install
58
58
 
59
- Install with [npm](https://www.npmjs.com/) (requires [Node.js](https://nodejs.org/en/) >=8.6):
59
+ Install with [npm](https://www.npmjs.com/):
60
60
 
61
61
  ```sh
62
62
  $ npm install --save micromatch
@@ -99,15 +99,15 @@ console.log(micromatch.isMatch('foo', ['b*', 'f*'])) //=> true
99
99
 
100
100
  > micromatch is a [replacement](#switching-to-micromatch) for minimatch and multimatch
101
101
 
102
- - Supports all of the same matching features as [minimatch][] and [multimatch][]
103
- - 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.
104
- - **Fast & Performant** - Loads in about 5ms and performs [fast matches](#benchmarks).
105
- - **Glob matching** - Using wildcards (`*` and `?`), globstars (`**`) for nested directories
106
- - **[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.
107
- - **Accurate** - Covers more scenarios [than minimatch](https://github.com/yarnpkg/yarn/pull/3339)
108
- - **Well tested** - More than 5,000 [test assertions](./test)
109
- - **Windows support** - More reliable windows support than minimatch and multimatch.
110
- - **[Safe][braces]{#braces-is-safe}** - Micromatch is not subject to DoS with brace patterns like minimatch and multimatch.
102
+ * Supports all of the same matching features as [minimatch](https://github.com/isaacs/minimatch) and [multimatch](https://github.com/sindresorhus/multimatch)
103
+ * 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.
104
+ * **Fast & Performant** - Loads in about 5ms and performs [fast matches](#benchmarks).
105
+ * **Glob matching** - Using wildcards (`*` and `?`), globstars (`**`) for nested directories
106
+ * **[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.
107
+ * **Accurate** - Covers more scenarios [than minimatch](https://github.com/yarnpkg/yarn/pull/3339)
108
+ * **Well tested** - More than 5,000 [test assertions](./test)
109
+ * **Windows support** - More reliable windows support than minimatch and multimatch.
110
+ * **[Safe](https://github.com/micromatch/braces#braces-is-safe)** - Micromatch is not subject to DoS with brace patterns like minimatch and multimatch.
111
111
 
112
112
  ### Matching features
113
113
 
@@ -116,7 +116,7 @@ console.log(micromatch.isMatch('foo', ['b*', 'f*'])) //=> true
116
116
  * Negation (`'!a/*.js'`, `'*!(b).js'`)
117
117
  * [extglobs](#extglobs) (`+(x|y)`, `!(a|b)`)
118
118
  * [POSIX character classes](#posix-bracket-expressions) (`[[:alpha:][:digit:]]`)
119
- * [brace expansion][braces] (`foo/{1..5}.md`, `bar/{a,b,c}.js`)
119
+ * [brace expansion](https://github.com/micromatch/braces) (`foo/{1..5}.md`, `bar/{a,b,c}.js`)
120
120
  * regex character classes (`foo-[1-5].js`)
121
121
  * regex logical "or" (`foo/(abc|xyz).js`)
122
122
 
@@ -167,7 +167,8 @@ console.log(mm(['a.js', 'a.txt'], ['*.js']));
167
167
  //=> [ 'a.js' ]
168
168
  ```
169
169
 
170
- ### [.matcher](index.js#L104)
170
+ ### [.matcher](index.js#L109)
171
+
171
172
  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.
172
173
 
173
174
  **Params**
@@ -187,7 +188,8 @@ console.log(isMatch('a.a')); //=> false
187
188
  console.log(isMatch('a.b')); //=> true
188
189
  ```
189
190
 
190
- ### [.isMatch](index.js#L123)
191
+ ### [.isMatch](index.js#L128)
192
+
191
193
  Returns true if **any** of the given glob `patterns` match the specified `string`.
192
194
 
193
195
  **Params**
@@ -207,7 +209,8 @@ console.log(mm.isMatch('a.a', ['b.*', '*.a'])); //=> true
207
209
  console.log(mm.isMatch('a.a', 'b.*')); //=> false
208
210
  ```
209
211
 
210
- ### [.not](index.js#L148)
212
+ ### [.not](index.js#L153)
213
+
211
214
  Returns a list of strings that _**do not match any**_ of the given `patterns`.
212
215
 
213
216
  **Params**
@@ -227,7 +230,8 @@ console.log(mm.not(['a.a', 'b.b', 'c.c'], '*.a'));
227
230
  //=> ['b.b', 'c.c']
228
231
  ```
229
232
 
230
- ### [.contains](index.js#L188)
233
+ ### [.contains](index.js#L193)
234
+
231
235
  Returns true if the given `string` contains the given pattern. Similar to [.isMatch](#isMatch) but the pattern can match any part of the string.
232
236
 
233
237
  **Params**
@@ -249,8 +253,9 @@ console.log(mm.contains('aa/bb/cc', '*d'));
249
253
  //=> false
250
254
  ```
251
255
 
252
- ### [.matchKeys](index.js#L230)
253
- 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][] instead.
256
+ ### [.matchKeys](index.js#L235)
257
+
258
+ 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.
254
259
 
255
260
  **Params**
256
261
 
@@ -270,7 +275,8 @@ console.log(mm.matchKeys(obj, '*b'));
270
275
  //=> { ab: 'b' }
271
276
  ```
272
277
 
273
- ### [.some](index.js#L259)
278
+ ### [.some](index.js#L264)
279
+
274
280
  Returns true if some of the strings in the given `list` match any of the given glob `patterns`.
275
281
 
276
282
  **Params**
@@ -292,7 +298,8 @@ console.log(mm.some(['foo.js'], ['*.js', '!foo.js']));
292
298
  // false
293
299
  ```
294
300
 
295
- ### [.every](index.js#L295)
301
+ ### [.every](index.js#L300)
302
+
296
303
  Returns true if every string in the given `list` matches any of the given glob `patterns`.
297
304
 
298
305
  **Params**
@@ -318,7 +325,8 @@ console.log(mm.every(['foo.js'], ['*.js', '!foo.js']));
318
325
  // false
319
326
  ```
320
327
 
321
- ### [.all](index.js#L334)
328
+ ### [.all](index.js#L339)
329
+
322
330
  Returns true if **all** of the given `patterns` match the specified string.
323
331
 
324
332
  **Params**
@@ -347,8 +355,9 @@ console.log(mm.all('foo.js', ['*.js', 'f*', '*o*', '*o.js']));
347
355
  // true
348
356
  ```
349
357
 
350
- ### [.capture](index.js#L361)
351
- Returns an array of matches captured by `pattern` in `string, or `null` if the pattern did not match.
358
+ ### [.capture](index.js#L366)
359
+
360
+ Returns an array of matches captured by `pattern` in `string, or`null` if the pattern did not match.
352
361
 
353
362
  **Params**
354
363
 
@@ -369,7 +378,8 @@ console.log(mm.capture('test/*.js', 'foo/bar.css'));
369
378
  //=> null
370
379
  ```
371
380
 
372
- ### [.makeRe](index.js#L387)
381
+ ### [.makeRe](index.js#L392)
382
+
373
383
  Create a regular expression from the given glob `pattern`.
374
384
 
375
385
  **Params**
@@ -388,7 +398,8 @@ console.log(mm.makeRe('*.js'));
388
398
  //=> /^(?:(\.[\\\/])?(?!\.)(?=.)[^\/]*?\.js)$/
389
399
  ```
390
400
 
391
- ### [.scan](index.js#L403)
401
+ ### [.scan](index.js#L408)
402
+
392
403
  Scan a glob pattern to separate the pattern into segments. Used by the [split](#split) method.
393
404
 
394
405
  **Params**
@@ -404,7 +415,8 @@ const mm = require('micromatch');
404
415
  const state = mm.scan(pattern[, options]);
405
416
  ```
406
417
 
407
- ### [.parse](index.js#L419)
418
+ ### [.parse](index.js#L424)
419
+
408
420
  Parse a glob pattern to create the source string for a regular expression.
409
421
 
410
422
  **Params**
@@ -420,13 +432,14 @@ const mm = require('micromatch');
420
432
  const state = mm.parse(pattern[, options]);
421
433
  ```
422
434
 
423
- ### [.braces](index.js#L446)
435
+ ### [.braces](index.js#L451)
436
+
424
437
  Process the given brace `pattern`.
425
438
 
426
439
  **Params**
427
440
 
428
441
  * `pattern` **{String}**: String with brace pattern to process.
429
- * `options` **{Object}**: Any [options](#options) to change how expansion is performed. See the [braces][] library for all available options.
442
+ * `options` **{Object}**: Any [options](#options) to change how expansion is performed. See the [braces](https://github.com/micromatch/braces) library for all available options.
430
443
  * `returns` **{Array}**
431
444
 
432
445
  **Example**
@@ -487,7 +500,7 @@ console.log(braces('foo/{a,b,c}/bar', { expand: true }));
487
500
 
488
501
  ### options.basename
489
502
 
490
- Allow glob patterns without slashes to match a file path based on its basename. Same behavior as [minimatch][] option `matchBase`.
503
+ Allow glob patterns without slashes to match a file path based on its basename. Same behavior as [minimatch](https://github.com/isaacs/minimatch) option `matchBase`.
491
504
 
492
505
  **Type**: `Boolean`
493
506
 
@@ -527,7 +540,7 @@ console.log(micromatch(files, '[a-c]*', { bash: false }));
527
540
 
528
541
  **Default**: `undefined`
529
542
 
530
- Custom function for expanding ranges in brace patterns. The [fill-range][] library is ideal for this purpose, or you can use custom code to do whatever you need.
543
+ Custom function for expanding ranges in brace patterns. The [fill-range](https://github.com/jonschlinkert/fill-range) library is ideal for this purpose, or you can use custom code to do whatever you need.
531
544
 
532
545
  **Example**
533
546
 
@@ -636,7 +649,7 @@ Alias for [options.nullglob](#options-nullglob).
636
649
 
637
650
  ### options.nullglob
638
651
 
639
- If `true`, when no matches are found the actual (arrayified) glob pattern is returned instead of an empty array. Same behavior as [minimatch][] option `nonull`.
652
+ If `true`, when no matches are found the actual (arrayified) glob pattern is returned instead of an empty array. Same behavior as [minimatch](https://github.com/isaacs/minimatch) option `nonull`.
640
653
 
641
654
  **Type**: `Boolean`
642
655
 
@@ -761,7 +774,7 @@ baz/2/qux
761
774
  baz/3/qux
762
775
  ```
763
776
 
764
- Visit [braces][] to see the full range of features and options related to brace expansion, or to create brace matching or expansion related issues.
777
+ Visit [braces](https://github.com/micromatch/braces) to see the full range of features and options related to brace expansion, or to create brace matching or expansion related issues.
765
778
 
766
779
  ### Regex character classes
767
780
 
@@ -771,7 +784,7 @@ Given the list: `['a.js', 'b.js', 'c.js', 'd.js', 'E.js']`:
771
784
  * `[b-d].js`: matches from `b` to `d`, returning `['b.js', 'c.js', 'd.js']`
772
785
  * `a/[A-Z].js`: matches and uppercase letter, returning `['a/E.md']`
773
786
 
774
- Learn about [regex character classes][charclass].
787
+ Learn about [regex character classes](http://www.regular-expressions.info/charclass.html).
775
788
 
776
789
  ### Regex groups
777
790
 
@@ -808,13 +821,13 @@ However, it's suprising how many edge cases and rabbit holes there are with glob
808
821
 
809
822
  There is an important, notable difference between minimatch and micromatch _in regards to how backslashes are handled_ in glob patterns.
810
823
 
811
- - Micromatch exclusively and explicitly reserves backslashes for escaping characters in a glob pattern, even on windows, which is consistent with bash behavior. _More importantly, unescaping globs can result in unsafe regular expressions_.
812
- - Minimatch converts all backslashes to forward slashes, which means you can't use backslashes to escape any characters in your glob patterns.
824
+ * Micromatch exclusively and explicitly reserves backslashes for escaping characters in a glob pattern, even on windows, which is consistent with bash behavior. _More importantly, unescaping globs can result in unsafe regular expressions_.
825
+ * Minimatch converts all backslashes to forward slashes, which means you can't use backslashes to escape any characters in your glob patterns.
813
826
 
814
827
  We made this decision for micromatch for a couple of reasons:
815
828
 
816
- - Consistency with bash conventions.
817
- - Glob patterns are not filepaths. They are a type of [regular language][regular-language] that is converted to a JavaScript regular expression. Thus, when forward slashes are defined in a glob pattern, the resulting regular expression will match windows or POSIX path separators just fine.
829
+ * Consistency with bash conventions.
830
+ * Glob patterns are not filepaths. They are a type of [regular language](https://en.wikipedia.org/wiki/Regular_language) that is converted to a JavaScript regular expression. Thus, when forward slashes are defined in a glob pattern, the resulting regular expression will match windows or POSIX path separators just fine.
818
831
 
819
832
  **A note about joining paths to globs**
820
833
 
@@ -842,7 +855,7 @@ $ npm run bench
842
855
 
843
856
  ### Latest results
844
857
 
845
- As of July 12, 2023 (longer bars are better):
858
+ As of August 23, 2024 (longer bars are better):
846
859
 
847
860
  ```sh
848
861
  # .makeRe star
@@ -902,25 +915,19 @@ All contributions are welcome! Please read [the contributing guide](.github/cont
902
915
 
903
916
  Please create an issue if you encounter a bug or matching behavior that doesn't seem correct. If you find a matching-related issue, please:
904
917
 
905
- - [research existing issues first](../../issues) (open and closed)
906
- - visit the [GNU Bash documentation][bash] to see how Bash deals with the pattern
907
- - visit the [minimatch][] documentation to cross-check expected behavior in node.js
908
- - if all else fails, since there is no real specification for globs we will probably need to discuss expected behavior and decide how to resolve it. which means any detail you can provide to help with this discussion would be greatly appreciated.
918
+ * [research existing issues first](../../issues) (open and closed)
919
+ * visit the [GNU Bash documentation](https://www.gnu.org/software/bash/manual/) to see how Bash deals with the pattern
920
+ * visit the [minimatch](https://github.com/isaacs/minimatch) documentation to cross-check expected behavior in node.js
921
+ * if all else fails, since there is no real specification for globs we will probably need to discuss expected behavior and decide how to resolve it. which means any detail you can provide to help with this discussion would be greatly appreciated.
909
922
 
910
923
  **Platform issues**
911
924
 
912
925
  It's important to us that micromatch work consistently on all platforms. If you encounter any platform-specific matching or path related issues, please let us know (pull requests are also greatly appreciated).
913
926
 
914
- [regular-language]: https://en.wikipedia.org/wiki/Regular_language
915
- [bash]: https://www.gnu.org/software/bash/manual/
916
- [charclass]: http://www.regular-expressions.info/charclass.html
917
- [extended]: http://mywiki.wooledge.org/BashGuide/Patterns#Extended_Globs
918
- [brackets]: https://github.com/micromatch/expand-brackets
919
- [braces]: https://github.com/micromatch/braces
920
-
921
927
  ## About
928
+
922
929
  <details>
923
- <summary><strong>Contributing</strong></summary>
930
+ <summary><strong>Contributing</strong></summary>
924
931
 
925
932
  Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).
926
933
 
@@ -929,7 +936,7 @@ Please read the [contributing guide](.github/contributing.md) for advice on open
929
936
  </details>
930
937
 
931
938
  <details>
932
- <summary><strong>Running Tests</strong></summary>
939
+ <summary><strong>Running Tests</strong></summary>
933
940
 
934
941
  Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
935
942
 
@@ -940,7 +947,7 @@ $ npm install && npm test
940
947
  </details>
941
948
 
942
949
  <details>
943
- <summary><strong>Building docs</strong></summary>
950
+ <summary><strong>Building docs</strong></summary>
944
951
 
945
952
  _(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_
946
953
 
@@ -956,62 +963,62 @@ $ npm install -g verbose/verb#dev verb-generate-readme && verb
956
963
 
957
964
  You might also be interested in these projects:
958
965
 
959
- - [braces](https://www.npmjs.com/package/braces): Bash-like brace expansion, implemented in JavaScript. Safer than other brace expansion libs, with complete support… [more](https://github.com/micromatch/braces) | [homepage](https://github.com/micromatch/braces "Bash-like brace expansion, implemented in JavaScript. Safer than other brace expansion libs, with complete support for the Bash 4.3 braces specification, without sacrificing speed.")
960
- - [expand-brackets](https://www.npmjs.com/package/expand-brackets): Expand POSIX bracket expressions (character classes) in glob patterns. | [homepage](https://github.com/micromatch/expand-brackets "Expand POSIX bracket expressions (character classes) in glob patterns.")
961
- - [extglob](https://www.npmjs.com/package/extglob): Extended glob support for JavaScript. Adds (almost) the expressive power of regular expressions to glob… [more](https://github.com/micromatch/extglob) | [homepage](https://github.com/micromatch/extglob "Extended glob support for JavaScript. Adds (almost) the expressive power of regular expressions to glob patterns.")
962
- - [fill-range](https://www.npmjs.com/package/fill-range): Fill in a range of numbers or letters, optionally passing an increment or `step` to… [more](https://github.com/jonschlinkert/fill-range) | [homepage](https://github.com/jonschlinkert/fill-range "Fill in a range of numbers or letters, optionally passing an increment or `step` to use, or create a regex-compatible range with `options.toRegex`")
963
- - [nanomatch](https://www.npmjs.com/package/nanomatch): Fast, minimal glob matcher for node.js. Similar to micromatch, minimatch and multimatch, but complete Bash… [more](https://github.com/micromatch/nanomatch) | [homepage](https://github.com/micromatch/nanomatch "Fast, minimal glob matcher for node.js. Similar to micromatch, minimatch and multimatch, but complete Bash 4.3 wildcard support only (no support for exglobs, posix brackets or braces)")
966
+ * [braces](https://www.npmjs.com/package/braces): Bash-like brace expansion, implemented in JavaScript. Safer than other brace expansion libs, with complete support… [more](https://github.com/micromatch/braces) | [homepage](https://github.com/micromatch/braces "Bash-like brace expansion, implemented in JavaScript. Safer than other brace expansion libs, with complete support for the Bash 4.3 braces specification, without sacrificing speed.")
967
+ * [expand-brackets](https://www.npmjs.com/package/expand-brackets): Expand POSIX bracket expressions (character classes) in glob patterns. | [homepage](https://github.com/micromatch/expand-brackets "Expand POSIX bracket expressions (character classes) in glob patterns.")
968
+ * [extglob](https://www.npmjs.com/package/extglob): Extended glob support for JavaScript. Adds (almost) the expressive power of regular expressions to glob… [more](https://github.com/micromatch/extglob) | [homepage](https://github.com/micromatch/extglob "Extended glob support for JavaScript. Adds (almost) the expressive power of regular expressions to glob patterns.")
969
+ * [fill-range](https://www.npmjs.com/package/fill-range): Fill in a range of numbers or letters, optionally passing an increment or `step` to… [more](https://github.com/jonschlinkert/fill-range) | [homepage](https://github.com/jonschlinkert/fill-range "Fill in a range of numbers or letters, optionally passing an increment or `step` to use, or create a regex-compatible range with `options.toRegex`")
970
+ * [nanomatch](https://www.npmjs.com/package/nanomatch): Fast, minimal glob matcher for node.js. Similar to micromatch, minimatch and multimatch, but complete Bash… [more](https://github.com/micromatch/nanomatch) | [homepage](https://github.com/micromatch/nanomatch "Fast, minimal glob matcher for node.js. Similar to micromatch, minimatch and multimatch, but complete Bash 4.3 wildcard support only (no support for exglobs, posix brackets or braces)")
964
971
 
965
972
  ### Contributors
966
- | **Commits** | **Contributor** |
967
- | --- | --- |
968
- | 515 | [jonschlinkert](https://github.com/jonschlinkert) |
969
- | 12 | [es128](https://github.com/es128) |
970
- | 9 | [danez](https://github.com/danez) |
971
- | 8 | [doowb](https://github.com/doowb) |
972
- | 6 | [paulmillr](https://github.com/paulmillr) |
973
- | 5 | [mrmlnc](https://github.com/mrmlnc) |
974
- | 3 | [DrPizza](https://github.com/DrPizza) |
975
- | 2 | [TrySound](https://github.com/TrySound) |
976
- | 2 | [mceIdo](https://github.com/mceIdo) |
977
- | 2 | [Glazy](https://github.com/Glazy) |
978
- | 2 | [MartinKolarik](https://github.com/MartinKolarik) |
979
- | 2 | [antonyk](https://github.com/antonyk) |
980
- | 2 | [Tvrqvoise](https://github.com/Tvrqvoise) |
981
- | 1 | [amilajack](https://github.com/amilajack) |
982
- | 1 | [Cslove](https://github.com/Cslove) |
983
- | 1 | [devongovett](https://github.com/devongovett) |
984
- | 1 | [DianeLooney](https://github.com/DianeLooney) |
985
- | 1 | [UltCombo](https://github.com/UltCombo) |
986
- | 1 | [frangio](https://github.com/frangio) |
987
- | 1 | [joyceerhl](https://github.com/joyceerhl) |
988
- | 1 | [juszczykjakub](https://github.com/juszczykjakub) |
989
- | 1 | [muescha](https://github.com/muescha) |
990
- | 1 | [sebdeckers](https://github.com/sebdeckers) |
991
- | 1 | [tomByrer](https://github.com/tomByrer) |
992
- | 1 | [fidian](https://github.com/fidian) |
993
- | 1 | [curbengh](https://github.com/curbengh) |
994
- | 1 | [simlu](https://github.com/simlu) |
995
- | 1 | [wtgtybhertgeghgtwtg](https://github.com/wtgtybhertgeghgtwtg) |
996
- | 1 | [yvele](https://github.com/yvele) |
973
+
974
+ | **Commits** | **Contributor** |
975
+ | --- | --- |
976
+ | 523 | [jonschlinkert](https://github.com/jonschlinkert) |
977
+ | 12 | [es128](https://github.com/es128) |
978
+ | 9 | [danez](https://github.com/danez) |
979
+ | 8 | [doowb](https://github.com/doowb) |
980
+ | 6 | [paulmillr](https://github.com/paulmillr) |
981
+ | 5 | [mrmlnc](https://github.com/mrmlnc) |
982
+ | 3 | [DrPizza](https://github.com/DrPizza) |
983
+ | 2 | [Tvrqvoise](https://github.com/Tvrqvoise) |
984
+ | 2 | [antonyk](https://github.com/antonyk) |
985
+ | 2 | [MartinKolarik](https://github.com/MartinKolarik) |
986
+ | 2 | [Glazy](https://github.com/Glazy) |
987
+ | 2 | [mceIdo](https://github.com/mceIdo) |
988
+ | 2 | [TrySound](https://github.com/TrySound) |
989
+ | 1 | [yvele](https://github.com/yvele) |
990
+ | 1 | [wtgtybhertgeghgtwtg](https://github.com/wtgtybhertgeghgtwtg) |
991
+ | 1 | [simlu](https://github.com/simlu) |
992
+ | 1 | [curbengh](https://github.com/curbengh) |
993
+ | 1 | [fidian](https://github.com/fidian) |
994
+ | 1 | [tomByrer](https://github.com/tomByrer) |
995
+ | 1 | [ZoomerTedJackson](https://github.com/ZoomerTedJackson) |
996
+ | 1 | [styfle](https://github.com/styfle) |
997
+ | 1 | [sebdeckers](https://github.com/sebdeckers) |
998
+ | 1 | [muescha](https://github.com/muescha) |
999
+ | 1 | [juszczykjakub](https://github.com/juszczykjakub) |
1000
+ | 1 | [joyceerhl](https://github.com/joyceerhl) |
1001
+ | 1 | [donatj](https://github.com/donatj) |
1002
+ | 1 | [frangio](https://github.com/frangio) |
1003
+ | 1 | [UltCombo](https://github.com/UltCombo) |
1004
+ | 1 | [DianeLooney](https://github.com/DianeLooney) |
1005
+ | 1 | [devongovett](https://github.com/devongovett) |
1006
+ | 1 | [Cslove](https://github.com/Cslove) |
1007
+ | 1 | [amilajack](https://github.com/amilajack) |
997
1008
 
998
1009
  ### Author
1010
+
999
1011
  **Jon Schlinkert**
1000
- + [GitHub Profile](https://github.com/jonschlinkert)
1001
- + [Twitter Profile](https://twitter.com/jonschlinkert)
1002
- + [LinkedIn Profile](https://linkedin.com/in/jonschlinkert)
1012
+
1013
+ * [GitHub Profile](https://github.com/jonschlinkert)
1014
+ * [Twitter Profile](https://twitter.com/jonschlinkert)
1015
+ * [LinkedIn Profile](https://linkedin.com/in/jonschlinkert)
1003
1016
 
1004
1017
  ### License
1005
- Copyright © 2023, [Jon Schlinkert](https://github.com/jonschlinkert).
1018
+
1019
+ Copyright © 2024, [Jon Schlinkert](https://github.com/jonschlinkert).
1006
1020
  Released under the [MIT License](LICENSE).
1007
1021
 
1008
1022
  ***
1009
1023
 
1010
- _This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on July 12, 2023._
1011
-
1012
- [extglob]: https://github.com/micromatch/extglob
1013
- [fill-range]: https://github.com/jonschlinkert/fill-range
1014
- [glob-object]: https://github.com/jonschlinkert/glob-object
1015
- [minimatch]: https://github.com/isaacs/minimatch
1016
- [multimatch]: https://github.com/sindresorhus/multimatch
1017
-
1024
+ _This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on August 23, 2024._
package/index.js CHANGED
@@ -4,7 +4,12 @@ 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 => val === '' || val === './';
7
+
8
+ const isEmptyString = v => v === '' || v === './';
9
+ const hasBraces = v => {
10
+ const index = v.indexOf('{');
11
+ return index > -1 && v.indexOf('}', index) > -1;
12
+ };
8
13
 
9
14
  /**
10
15
  * Returns an array of strings that match one or more glob patterns.
@@ -445,7 +450,7 @@ micromatch.parse = (patterns, options) => {
445
450
 
446
451
  micromatch.braces = (pattern, options) => {
447
452
  if (typeof pattern !== 'string') throw new TypeError('Expected a string');
448
- if ((options && options.nobrace === true) || !/\{.*\}/.test(pattern)) {
453
+ if ((options && options.nobrace === true) || !hasBraces(pattern)) {
449
454
  return [pattern];
450
455
  }
451
456
  return braces(pattern, options);
@@ -464,4 +469,6 @@ micromatch.braceExpand = (pattern, options) => {
464
469
  * Expose micromatch
465
470
  */
466
471
 
472
+ // exposed for tests
473
+ micromatch.hasBraces = hasBraces;
467
474
  module.exports = micromatch;
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.7",
4
+ "version": "4.0.8",
5
5
  "homepage": "https://github.com/micromatch/micromatch",
6
6
  "author": "Jon Schlinkert (https://github.com/jonschlinkert)",
7
7
  "contributors": [
@@ -26,7 +26,9 @@
26
26
  "url": "https://github.com/micromatch/micromatch/issues"
27
27
  },
28
28
  "license": "MIT",
29
- "files": ["index.js"],
29
+ "files": [
30
+ "index.js"
31
+ ],
30
32
  "main": "index.js",
31
33
  "engines": {
32
34
  "node": ">=8.6"
@@ -88,14 +90,30 @@
88
90
  "verb": {
89
91
  "toc": "collapsible",
90
92
  "layout": "default",
91
- "tasks": ["readme"],
92
- "plugins": ["gulp-format-md"],
93
+ "tasks": [
94
+ "readme"
95
+ ],
96
+ "plugins": [
97
+ "gulp-format-md"
98
+ ],
93
99
  "lint": {
94
100
  "reflinks": true
95
101
  },
96
102
  "related": {
97
- "list": ["braces", "expand-brackets", "extglob", "fill-range", "nanomatch"]
103
+ "list": [
104
+ "braces",
105
+ "expand-brackets",
106
+ "extglob",
107
+ "fill-range",
108
+ "nanomatch"
109
+ ]
98
110
  },
99
- "reflinks": ["extglob", "fill-range", "glob-object", "minimatch", "multimatch"]
111
+ "reflinks": [
112
+ "extglob",
113
+ "fill-range",
114
+ "glob-object",
115
+ "minimatch",
116
+ "multimatch"
117
+ ]
100
118
  }
101
119
  }