micromatch 4.0.4 → 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.
- package/README.md +94 -78
- package/index.js +12 -5
- package/package.json +5 -5
- package/CHANGELOG.md +0 -109
package/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# micromatch [](https://www.npmjs.com/package/micromatch) [](https://npmjs.org/package/micromatch) [](https://npmjs.org/package/micromatch)
|
1
|
+
# 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)
|
2
2
|
|
3
3
|
> Glob matching for javascript/node.js. A replacement and faster alternative to minimatch and multimatch.
|
4
4
|
|
@@ -9,46 +9,48 @@ Please consider following this project's author, [Jon Schlinkert](https://github
|
|
9
9
|
<details>
|
10
10
|
<summary><strong>Details</strong></summary>
|
11
11
|
|
12
|
-
|
13
|
-
- [
|
14
|
-
|
15
|
-
* [
|
16
|
-
|
17
|
-
|
18
|
-
* [
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
* [
|
23
|
-
* [
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
* [
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
* [
|
47
|
-
|
48
|
-
|
49
|
-
* [
|
50
|
-
|
51
|
-
|
12
|
+
* [Install](#install)
|
13
|
+
- [Sponsors](#sponsors)
|
14
|
+
* [Gold Sponsors](#gold-sponsors)
|
15
|
+
* [Quickstart](#quickstart)
|
16
|
+
* [Why use micromatch?](#why-use-micromatch)
|
17
|
+
+ [Matching features](#matching-features)
|
18
|
+
* [Switching to micromatch](#switching-to-micromatch)
|
19
|
+
+ [From minimatch](#from-minimatch)
|
20
|
+
+ [From multimatch](#from-multimatch)
|
21
|
+
* [API](#api)
|
22
|
+
* [Options](#options)
|
23
|
+
* [Options Examples](#options-examples)
|
24
|
+
+ [options.basename](#optionsbasename)
|
25
|
+
+ [options.bash](#optionsbash)
|
26
|
+
+ [options.expandRange](#optionsexpandrange)
|
27
|
+
+ [options.format](#optionsformat)
|
28
|
+
+ [options.ignore](#optionsignore)
|
29
|
+
+ [options.matchBase](#optionsmatchbase)
|
30
|
+
+ [options.noextglob](#optionsnoextglob)
|
31
|
+
+ [options.nonegate](#optionsnonegate)
|
32
|
+
+ [options.noglobstar](#optionsnoglobstar)
|
33
|
+
+ [options.nonull](#optionsnonull)
|
34
|
+
+ [options.nullglob](#optionsnullglob)
|
35
|
+
+ [options.onIgnore](#optionsonignore)
|
36
|
+
+ [options.onMatch](#optionsonmatch)
|
37
|
+
+ [options.onResult](#optionsonresult)
|
38
|
+
+ [options.posixSlashes](#optionsposixslashes)
|
39
|
+
+ [options.unescape](#optionsunescape)
|
40
|
+
* [Extended globbing](#extended-globbing)
|
41
|
+
+ [Extglobs](#extglobs)
|
42
|
+
+ [Braces](#braces)
|
43
|
+
+ [Regex character classes](#regex-character-classes)
|
44
|
+
+ [Regex groups](#regex-groups)
|
45
|
+
+ [POSIX bracket expressions](#posix-bracket-expressions)
|
46
|
+
* [Notes](#notes)
|
47
|
+
+ [Bash 4.3 parity](#bash-43-parity)
|
48
|
+
+ [Backslashes](#backslashes)
|
49
|
+
* [Benchmarks](#benchmarks)
|
50
|
+
+ [Running benchmarks](#running-benchmarks)
|
51
|
+
+ [Latest results](#latest-results)
|
52
|
+
* [Contributing](#contributing)
|
53
|
+
* [About](#about)
|
52
54
|
|
53
55
|
</details>
|
54
56
|
|
@@ -60,6 +62,14 @@ Install with [npm](https://www.npmjs.com/):
|
|
60
62
|
$ npm install --save micromatch
|
61
63
|
```
|
62
64
|
|
65
|
+
<br />
|
66
|
+
|
67
|
+
# Sponsors
|
68
|
+
|
69
|
+
[Become a Sponsor](https://github.com/sponsors/jonschlinkert) to add your logo to this README, or any of [my other projects](https://github.com/jonschlinkert?tab=repositories&q=&type=&language=&sort=stargazers)
|
70
|
+
|
71
|
+
<br />
|
72
|
+
|
63
73
|
## Quickstart
|
64
74
|
|
65
75
|
```js
|
@@ -103,7 +113,7 @@ console.log(micromatch.isMatch('foo', ['b*', 'f*'])) //=> true
|
|
103
113
|
|
104
114
|
* Support for multiple glob patterns (no need for wrappers like multimatch)
|
105
115
|
* Wildcards (`**`, `*.js`)
|
106
|
-
* Negation (`'!a/*.js'`, `'*!(b).js'
|
116
|
+
* Negation (`'!a/*.js'`, `'*!(b).js'`)
|
107
117
|
* [extglobs](#extglobs) (`+(x|y)`, `!(a|b)`)
|
108
118
|
* [POSIX character classes](#posix-bracket-expressions) (`[[:alpha:][:digit:]]`)
|
109
119
|
* [brace expansion](https://github.com/micromatch/braces) (`foo/{1..5}.md`, `bar/{a,b,c}.js`)
|
@@ -157,7 +167,7 @@ console.log(mm(['a.js', 'a.txt'], ['*.js']));
|
|
157
167
|
//=> [ 'a.js' ]
|
158
168
|
```
|
159
169
|
|
160
|
-
### [.matcher](index.js#
|
170
|
+
### [.matcher](index.js#L109)
|
161
171
|
|
162
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.
|
163
173
|
|
@@ -178,7 +188,7 @@ console.log(isMatch('a.a')); //=> false
|
|
178
188
|
console.log(isMatch('a.b')); //=> true
|
179
189
|
```
|
180
190
|
|
181
|
-
### [.isMatch](index.js#
|
191
|
+
### [.isMatch](index.js#L128)
|
182
192
|
|
183
193
|
Returns true if **any** of the given glob `patterns` match the specified `string`.
|
184
194
|
|
@@ -199,7 +209,7 @@ console.log(mm.isMatch('a.a', ['b.*', '*.a'])); //=> true
|
|
199
209
|
console.log(mm.isMatch('a.a', 'b.*')); //=> false
|
200
210
|
```
|
201
211
|
|
202
|
-
### [.not](index.js#
|
212
|
+
### [.not](index.js#L153)
|
203
213
|
|
204
214
|
Returns a list of strings that _**do not match any**_ of the given `patterns`.
|
205
215
|
|
@@ -220,7 +230,7 @@ console.log(mm.not(['a.a', 'b.b', 'c.c'], '*.a'));
|
|
220
230
|
//=> ['b.b', 'c.c']
|
221
231
|
```
|
222
232
|
|
223
|
-
### [.contains](index.js#
|
233
|
+
### [.contains](index.js#L193)
|
224
234
|
|
225
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.
|
226
236
|
|
@@ -243,7 +253,7 @@ console.log(mm.contains('aa/bb/cc', '*d'));
|
|
243
253
|
//=> false
|
244
254
|
```
|
245
255
|
|
246
|
-
### [.matchKeys](index.js#
|
256
|
+
### [.matchKeys](index.js#L235)
|
247
257
|
|
248
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.
|
249
259
|
|
@@ -265,7 +275,7 @@ console.log(mm.matchKeys(obj, '*b'));
|
|
265
275
|
//=> { ab: 'b' }
|
266
276
|
```
|
267
277
|
|
268
|
-
### [.some](index.js#
|
278
|
+
### [.some](index.js#L264)
|
269
279
|
|
270
280
|
Returns true if some of the strings in the given `list` match any of the given glob `patterns`.
|
271
281
|
|
@@ -288,7 +298,7 @@ console.log(mm.some(['foo.js'], ['*.js', '!foo.js']));
|
|
288
298
|
// false
|
289
299
|
```
|
290
300
|
|
291
|
-
### [.every](index.js#
|
301
|
+
### [.every](index.js#L300)
|
292
302
|
|
293
303
|
Returns true if every string in the given `list` matches any of the given glob `patterns`.
|
294
304
|
|
@@ -315,7 +325,7 @@ console.log(mm.every(['foo.js'], ['*.js', '!foo.js']));
|
|
315
325
|
// false
|
316
326
|
```
|
317
327
|
|
318
|
-
### [.all](index.js#
|
328
|
+
### [.all](index.js#L339)
|
319
329
|
|
320
330
|
Returns true if **all** of the given `patterns` match the specified string.
|
321
331
|
|
@@ -345,7 +355,7 @@ console.log(mm.all('foo.js', ['*.js', 'f*', '*o*', '*o.js']));
|
|
345
355
|
// true
|
346
356
|
```
|
347
357
|
|
348
|
-
### [.capture](index.js#
|
358
|
+
### [.capture](index.js#L366)
|
349
359
|
|
350
360
|
Returns an array of matches captured by `pattern` in `string, or`null` if the pattern did not match.
|
351
361
|
|
@@ -368,7 +378,7 @@ console.log(mm.capture('test/*.js', 'foo/bar.css'));
|
|
368
378
|
//=> null
|
369
379
|
```
|
370
380
|
|
371
|
-
### [.makeRe](index.js#
|
381
|
+
### [.makeRe](index.js#L392)
|
372
382
|
|
373
383
|
Create a regular expression from the given glob `pattern`.
|
374
384
|
|
@@ -388,7 +398,7 @@ console.log(mm.makeRe('*.js'));
|
|
388
398
|
//=> /^(?:(\.[\\\/])?(?!\.)(?=.)[^\/]*?\.js)$/
|
389
399
|
```
|
390
400
|
|
391
|
-
### [.scan](index.js#
|
401
|
+
### [.scan](index.js#L408)
|
392
402
|
|
393
403
|
Scan a glob pattern to separate the pattern into segments. Used by the [split](#split) method.
|
394
404
|
|
@@ -405,7 +415,7 @@ const mm = require('micromatch');
|
|
405
415
|
const state = mm.scan(pattern[, options]);
|
406
416
|
```
|
407
417
|
|
408
|
-
### [.parse](index.js#
|
418
|
+
### [.parse](index.js#L424)
|
409
419
|
|
410
420
|
Parse a glob pattern to create the source string for a regular expression.
|
411
421
|
|
@@ -419,10 +429,10 @@ Parse a glob pattern to create the source string for a regular expression.
|
|
419
429
|
|
420
430
|
```js
|
421
431
|
const mm = require('micromatch');
|
422
|
-
const state = mm(pattern[, options]);
|
432
|
+
const state = mm.parse(pattern[, options]);
|
423
433
|
```
|
424
434
|
|
425
|
-
### [.braces](index.js#
|
435
|
+
### [.braces](index.js#L451)
|
426
436
|
|
427
437
|
Process the given brace `pattern`.
|
428
438
|
|
@@ -845,7 +855,7 @@ $ npm run bench
|
|
845
855
|
|
846
856
|
### Latest results
|
847
857
|
|
848
|
-
As of
|
858
|
+
As of August 23, 2024 (longer bars are better):
|
849
859
|
|
850
860
|
```sh
|
851
861
|
# .makeRe star
|
@@ -963,32 +973,38 @@ You might also be interested in these projects:
|
|
963
973
|
|
964
974
|
| **Commits** | **Contributor** |
|
965
975
|
| --- | --- |
|
966
|
-
|
|
976
|
+
| 523 | [jonschlinkert](https://github.com/jonschlinkert) |
|
967
977
|
| 12 | [es128](https://github.com/es128) |
|
978
|
+
| 9 | [danez](https://github.com/danez) |
|
968
979
|
| 8 | [doowb](https://github.com/doowb) |
|
969
980
|
| 6 | [paulmillr](https://github.com/paulmillr) |
|
970
981
|
| 5 | [mrmlnc](https://github.com/mrmlnc) |
|
971
|
-
| 4 | [danez](https://github.com/danez) |
|
972
982
|
| 3 | [DrPizza](https://github.com/DrPizza) |
|
973
|
-
| 2 | [TrySound](https://github.com/TrySound) |
|
974
|
-
| 2 | [mceIdo](https://github.com/mceIdo) |
|
975
|
-
| 2 | [Glazy](https://github.com/Glazy) |
|
976
|
-
| 2 | [MartinKolarik](https://github.com/MartinKolarik) |
|
977
983
|
| 2 | [Tvrqvoise](https://github.com/Tvrqvoise) |
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
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) |
|
987
|
-
| 1 | [tomByrer](https://github.com/tomByrer) |
|
988
|
-
| 1 | [fidian](https://github.com/fidian) |
|
989
|
-
| 1 | [simlu](https://github.com/simlu) |
|
990
|
-
| 1 | [wtgtybhertgeghgtwtg](https://github.com/wtgtybhertgeghgtwtg) |
|
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) |
|
991
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) |
|
992
1008
|
|
993
1009
|
### Author
|
994
1010
|
|
@@ -1000,9 +1016,9 @@ You might also be interested in these projects:
|
|
1000
1016
|
|
1001
1017
|
### License
|
1002
1018
|
|
1003
|
-
Copyright ©
|
1019
|
+
Copyright © 2024, [Jon Schlinkert](https://github.com/jonschlinkert).
|
1004
1020
|
Released under the [MIT License](LICENSE).
|
1005
1021
|
|
1006
1022
|
***
|
1007
1023
|
|
1008
|
-
_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on
|
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
|
-
|
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.
|
@@ -155,10 +160,10 @@ micromatch.not = (list, patterns, options = {}) => {
|
|
155
160
|
items.push(state.output);
|
156
161
|
};
|
157
162
|
|
158
|
-
let matches = micromatch(list, patterns, { ...options, onResult });
|
163
|
+
let matches = new Set(micromatch(list, patterns, { ...options, onResult }));
|
159
164
|
|
160
165
|
for (let item of items) {
|
161
|
-
if (!matches.
|
166
|
+
if (!matches.has(item)) {
|
162
167
|
result.add(item);
|
163
168
|
}
|
164
169
|
}
|
@@ -408,7 +413,7 @@ micromatch.scan = (...args) => picomatch.scan(...args);
|
|
408
413
|
*
|
409
414
|
* ```js
|
410
415
|
* const mm = require('micromatch');
|
411
|
-
* const state = mm(pattern[, options]);
|
416
|
+
* const state = mm.parse(pattern[, options]);
|
412
417
|
* ```
|
413
418
|
* @param {String} `glob`
|
414
419
|
* @param {Object} `options`
|
@@ -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) ||
|
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.
|
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": [
|
@@ -37,14 +37,14 @@
|
|
37
37
|
"test": "mocha"
|
38
38
|
},
|
39
39
|
"dependencies": {
|
40
|
-
"braces": "^3.0.
|
41
|
-
"picomatch": "^2.
|
40
|
+
"braces": "^3.0.3",
|
41
|
+
"picomatch": "^2.3.1"
|
42
42
|
},
|
43
43
|
"devDependencies": {
|
44
44
|
"fill-range": "^7.0.1",
|
45
45
|
"gulp-format-md": "^2.0.0",
|
46
|
-
"minimatch": "^
|
47
|
-
"mocha": "^
|
46
|
+
"minimatch": "^5.0.1",
|
47
|
+
"mocha": "^9.2.2",
|
48
48
|
"time-require": "github:jonschlinkert/time-require"
|
49
49
|
},
|
50
50
|
"keywords": [
|
package/CHANGELOG.md
DELETED
@@ -1,109 +0,0 @@
|
|
1
|
-
# Release history
|
2
|
-
|
3
|
-
All notable changes to this project will be documented in this file.
|
4
|
-
|
5
|
-
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
6
|
-
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
7
|
-
|
8
|
-
<details>
|
9
|
-
<summary><strong>Guiding Principles</strong></summary>
|
10
|
-
|
11
|
-
- Changelogs are for humans, not machines.
|
12
|
-
- There should be an entry for every single version.
|
13
|
-
- The same types of changes should be grouped.
|
14
|
-
- Versions and sections should be linkable.
|
15
|
-
- The latest version comes first.
|
16
|
-
- The release date of each versions is displayed.
|
17
|
-
- Mention whether you follow Semantic Versioning.
|
18
|
-
|
19
|
-
</details>
|
20
|
-
|
21
|
-
<details>
|
22
|
-
<summary><strong>Types of changes</strong></summary>
|
23
|
-
|
24
|
-
Changelog entries are classified using the following labels _(from [keep-a-changelog](http://keepachangelog.com/)_):
|
25
|
-
|
26
|
-
- `Added` for new features.
|
27
|
-
- `Changed` for changes in existing functionality.
|
28
|
-
- `Deprecated` for soon-to-be removed features.
|
29
|
-
- `Removed` for now removed features.
|
30
|
-
- `Fixed` for any bug fixes.
|
31
|
-
- `Security` in case of vulnerabilities.
|
32
|
-
|
33
|
-
</details>
|
34
|
-
|
35
|
-
## [4.0.0] - 2019-03-20
|
36
|
-
|
37
|
-
### Added
|
38
|
-
|
39
|
-
- Adds support for `options.onMatch`. See the readme for details
|
40
|
-
- Adds support for `options.onIgnore`. See the readme for details
|
41
|
-
- Adds support for `options.onResult`. See the readme for details
|
42
|
-
|
43
|
-
|
44
|
-
### Breaking changes
|
45
|
-
|
46
|
-
- Require Node.js >= 8.6
|
47
|
-
- Removed support for passing an array of brace patterns to `micromatch.braces()`.
|
48
|
-
- To strictly enforce closing brackets (for `{`, `[`, and `(`), you must now use `strictBrackets=true` instead of `strictErrors`.
|
49
|
-
- `cache` - caching and all related options and methods have been removed
|
50
|
-
- `options.unixify` was renamed to `options.windows`
|
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.
|
52
|
-
- `options.snapdragon` was removed, as snapdragon is no longer used.
|
53
|
-
- `options.sourcemap` was removed, as snapdragon is no longer used, which provided sourcemap support.
|
54
|
-
|
55
|
-
## [3.0.0] - 2017-04-11
|
56
|
-
|
57
|
-
Complete overhaul, with 36,000+ new unit tests validated against actual output generated by Bash and minimatch. More specifically, 35,000+ of the tests:
|
58
|
-
|
59
|
-
- micromatch results are directly compared to bash results
|
60
|
-
- in rare cases, when micromatch and bash disagree, micromatch's results are compared to minimatch's results
|
61
|
-
- micromatch is much more accurate than minimatch, so there were cases where I had to make assumptions. I'll try to document these.
|
62
|
-
|
63
|
-
This refactor introduces a parser and compiler that are supersets of more granular parsers and compilers from other sub-modules. Each of these sub-modules has a singular responsibility and focuses on a certain type of matching that aligns with a specific part of the Bash "expansion" API.
|
64
|
-
|
65
|
-
These sub-modules work like plugins to seamlessly create the micromatch parser/compiler, so that strings are parsed in one pass, an [AST is created](https://gist.github.com/jonschlinkert/099c8914f56529f75bc757cc9e5e8e2a), then a new string is generated by the compiler.
|
66
|
-
|
67
|
-
Here are those sub-modules with links to related prs on those modules if you want to see how they contribute to this code:
|
68
|
-
|
69
|
-
[nanomatch](https://github.com/jonschlinkert/nanomatch) (new library) - glob expansion (`*`, `**`, `?` and `[...]`))
|
70
|
-
[braces](https://github.com/jonschlinkert/braces/pull/10) - brace expansion (`{1..10}`, `{a,b,c}`, etc)
|
71
|
-
[extglob](https://github.com/jonschlinkert/extglob/pull/5) - extended globs (`!(a|b)`, `@(!(foo|bar))`, etc)
|
72
|
-
[expand-brackets](https://github.com/jonschlinkert/expand-brackets/pull/5) - POSIX character classes `[[:alpha:][:digit:]]`
|
73
|
-
|
74
|
-
**Added**
|
75
|
-
|
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).
|
77
|
-
- parser is exposed, so that implementors can customize or override specific micromatch parsers if necessary
|
78
|
-
- compiler is exposed, so that implementors can customize or override specific micromatch compilers if necessary
|
79
|
-
|
80
|
-
**Fixed**
|
81
|
-
|
82
|
-
- more accurate matching (passes 100% of Bash 4.3 of the brace expansion and extglob unit tests, as well as all Bash glob tests that are relevant to node.js usage, all minimatch tests, all brace-expansion tests, and also passes a couple of tests that bash fails)
|
83
|
-
- even safer - micromatch has always generated optimized patterns so it's not subject to DoS exploits like minimatch (completely different than the regex DoS issue, minimatch and multimatch are still openly exposed to being used for DoS attacks), but more safeguards were built into this refactor
|
84
|
-
|
85
|
-
**Changed**
|
86
|
-
|
87
|
-
- the public API of this library did not change in this version and should be safe to upgrade without changing implentor code. However, we have released this as a major version for the following reasons:
|
88
|
-
- out of an abundance of caution due to the large amount of code changed in this release
|
89
|
-
- we have improved parser accuracy to such a degree that some implementors using invalid globs have noted change in behavior. If this is the case for you, please check that you are using a valid glob expression before logging a bug with this library
|
90
|
-
|
91
|
-
## [1.0.1] - 2016-12-12
|
92
|
-
|
93
|
-
**Added**
|
94
|
-
|
95
|
-
- Support for windows path edge cases where backslashes are used in brackets or other unusual combinations.
|
96
|
-
|
97
|
-
## [1.0.0] - 2016-12-12
|
98
|
-
|
99
|
-
Stable release.
|
100
|
-
|
101
|
-
## [0.1.0] - 2016-10-08
|
102
|
-
|
103
|
-
First release.
|
104
|
-
|
105
|
-
|
106
|
-
[Unreleased]: https://github.com/jonschlinkert/micromatch/compare/0.1.0...HEAD
|
107
|
-
[0.2.0]: https://github.com/jonschlinkert/micromatch/compare/0.1.0...0.2.0
|
108
|
-
|
109
|
-
[keep-a-changelog]: https://github.com/olivierlacan/keep-a-changelog
|