minimatch
Advanced tools
Comparing version 5.0.1 to 5.1.0
@@ -171,2 +171,7 @@ const minimatch = module.exports = (p, pattern, options = {}) => { | ||
this.pattern = pattern | ||
this.windowsPathsNoEscape = !!options.windowsPathsNoEscape || | ||
options.allowWindowsEscape === false | ||
if (this.windowsPathsNoEscape) { | ||
this.pattern = this.pattern.replace(/\\/g, '/') | ||
} | ||
this.regexp = null | ||
@@ -173,0 +178,0 @@ this.negate = false |
@@ -5,3 +5,3 @@ { | ||
"description": "a glob matcher in javascript", | ||
"version": "5.0.1", | ||
"version": "5.1.0", | ||
"repository": { | ||
@@ -8,0 +8,0 @@ "type": "git", |
@@ -123,3 +123,3 @@ # minimatch | ||
```javascript | ||
var javascripts = minimatch.match(fileList, "*.js", {matchBase: true})) | ||
var javascripts = minimatch.match(fileList, "*.js", {matchBase: true}) | ||
``` | ||
@@ -205,2 +205,17 @@ | ||
### windowsPathsNoEscape | ||
Use `\\` as a path separator _only_, and _never_ as an escape | ||
character. If set, all `\\` characters are replaced with `/` in | ||
the pattern. Note that this makes it **impossible** to match | ||
against paths containing literal glob pattern characters, but | ||
allows matching with patterns constructed using `path.join()` and | ||
`path.resolve()` on Windows platforms, mimicking the (buggy!) | ||
behavior of earlier versions on Windows. Please use with | ||
caution, and be mindful of [the caveat about Windows | ||
paths](#windows). | ||
For legacy reasons, this is also set if | ||
`options.allowWindowsEscape` is set to the exact value `false`. | ||
## Comparisons to other fnmatch/glob implementations | ||
@@ -207,0 +222,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
37474
769
260