Comparing version 2.0.5 to 2.0.6
@@ -96,2 +96,3 @@ 'use strict'; | ||
REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g, | ||
REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g, | ||
@@ -98,0 +99,0 @@ // Replace globs with equivalent patterns to reduce parsing time. |
@@ -625,3 +625,3 @@ 'use strict'; | ||
if (next === '<' && parseInt(process.version.slice(1), 10) < 10) { | ||
if (next === '<' && !utils.supportsLookbehinds()) { | ||
throw new Error('Node.js v10 or higher is required for regex lookbehinds'); | ||
@@ -628,0 +628,0 @@ } |
'use strict'; | ||
const utils = require('./utils'); | ||
const { | ||
@@ -209,6 +211,6 @@ CHAR_ASTERISK, /* * */ | ||
if (opts.unescape === true) { | ||
if (glob) glob = removeBackslashes(glob); | ||
if (glob) glob = utils.removeBackslashes(glob); | ||
if (base && backslashes === true) { | ||
base = removeBackslashes(base); | ||
base = utils.removeBackslashes(base); | ||
} | ||
@@ -219,7 +221,1 @@ } | ||
}; | ||
function removeBackslashes(str) { | ||
return str.replace(/(?:\[.*?(?<!\\)\]|\\(?=.))/g, match => { | ||
return match === '\\' ? '' : match; | ||
}); | ||
} |
@@ -7,3 +7,4 @@ 'use strict'; | ||
REGEX_SPECIAL_CHARS, | ||
REGEX_SPECIAL_CHARS_GLOBAL | ||
REGEX_SPECIAL_CHARS_GLOBAL, | ||
REGEX_REMOVE_BACKSLASH | ||
} = require('./constants'); | ||
@@ -17,2 +18,16 @@ | ||
exports.removeBackslashes = str => { | ||
return str.replace(REGEX_REMOVE_BACKSLASH, match => { | ||
return match === '\\' ? '' : match; | ||
}); | ||
} | ||
exports.supportsLookbehinds = () => { | ||
let segs = process.version.slice(1).split('.'); | ||
if (segs.length === 3 && +segs[0] >= 8 && +segs[1] >= 10) { | ||
return true; | ||
} | ||
return false; | ||
}; | ||
exports.isWindows = options => { | ||
@@ -19,0 +34,0 @@ if (options && typeof options.windows === 'boolean') { |
{ | ||
"name": "picomatch", | ||
"description": "Blazing fast and accurate glob matcher written in JavaScript, with no dependencies and full support for standard and extended Bash glob features, including braces, extglobs, POSIX brackets, and regular expressions.", | ||
"version": "2.0.5", | ||
"version": "2.0.6", | ||
"homepage": "https://github.com/micromatch/picomatch", | ||
@@ -65,2 +65,2 @@ "author": "Jon Schlinkert (https://github.com/jonschlinkert)", | ||
} | ||
} | ||
} |
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
73472
1465