minimatch 5.0.1 → 5.1.0
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 +16 -1
- package/minimatch.js +5 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -120,7 +120,7 @@ files, in the style of fnmatch or glob. If nothing is matched, and
|
|
|
120
120
|
options.nonull is set, then return a list containing the pattern itself.
|
|
121
121
|
|
|
122
122
|
```javascript
|
|
123
|
-
var javascripts = minimatch.match(fileList, "*.js", {matchBase: true})
|
|
123
|
+
var javascripts = minimatch.match(fileList, "*.js", {matchBase: true})
|
|
124
124
|
```
|
|
125
125
|
|
|
126
126
|
### minimatch.makeRe(pattern, options)
|
|
@@ -201,6 +201,21 @@ minimatch('/a/b', '/**/d', { partial: true }) // true, might be /a/b/.../d
|
|
|
201
201
|
minimatch('/x/y/z', '/a/**/z', { partial: true }) // false, because x !== a
|
|
202
202
|
```
|
|
203
203
|
|
|
204
|
+
### windowsPathsNoEscape
|
|
205
|
+
|
|
206
|
+
Use `\\` as a path separator _only_, and _never_ as an escape
|
|
207
|
+
character. If set, all `\\` characters are replaced with `/` in
|
|
208
|
+
the pattern. Note that this makes it **impossible** to match
|
|
209
|
+
against paths containing literal glob pattern characters, but
|
|
210
|
+
allows matching with patterns constructed using `path.join()` and
|
|
211
|
+
`path.resolve()` on Windows platforms, mimicking the (buggy!)
|
|
212
|
+
behavior of earlier versions on Windows. Please use with
|
|
213
|
+
caution, and be mindful of [the caveat about Windows
|
|
214
|
+
paths](#windows).
|
|
215
|
+
|
|
216
|
+
For legacy reasons, this is also set if
|
|
217
|
+
`options.allowWindowsEscape` is set to the exact value `false`.
|
|
218
|
+
|
|
204
219
|
## Comparisons to other fnmatch/glob implementations
|
|
205
220
|
|
|
206
221
|
While strict compliance with the existing standards is a worthwhile
|
package/minimatch.js
CHANGED
|
@@ -168,6 +168,11 @@ class Minimatch {
|
|
|
168
168
|
this.options = options
|
|
169
169
|
this.set = []
|
|
170
170
|
this.pattern = pattern
|
|
171
|
+
this.windowsPathsNoEscape = !!options.windowsPathsNoEscape ||
|
|
172
|
+
options.allowWindowsEscape === false
|
|
173
|
+
if (this.windowsPathsNoEscape) {
|
|
174
|
+
this.pattern = this.pattern.replace(/\\/g, '/')
|
|
175
|
+
}
|
|
171
176
|
this.regexp = null
|
|
172
177
|
this.negate = false
|
|
173
178
|
this.comment = false
|
package/package.json
CHANGED