jest-regex-util
Advanced tools
Comparing version 30.0.0-alpha.2 to 30.0.0-alpha.3
@@ -34,3 +34,3 @@ /*! | ||
// replacePathSepForRegex will convert it back. | ||
dir = dir.replace(/\\/g, '/'); | ||
dir = dir.replaceAll('\\', '/'); | ||
} | ||
@@ -40,7 +40,7 @@ return replacePathSepForRegex(escapeStrForRegex(dir)); | ||
exports.escapePathForRegex = escapePathForRegex; | ||
const escapeStrForRegex = string => string.replace(/[[\]{}()*+?.\\^$|]/g, '\\$&'); | ||
const escapeStrForRegex = string => string.replaceAll(/[$()*+.?[\\\]^{|}]/g, '\\$&'); | ||
exports.escapeStrForRegex = escapeStrForRegex; | ||
const replacePathSepForRegex = string => { | ||
if (_path.sep === '\\') { | ||
return string.replace(/(\/|(.)?\\(?![[\]{}()*+?.^$|\\]))/g, (_match, _, p2) => p2 && p2 !== '\\' ? `${p2}\\\\` : '\\\\'); | ||
return string.replaceAll(/(\/|(.)?\\(?![$()*+.?[\\\]^{|}]))/g, (_match, _, p2) => p2 && p2 !== '\\' ? `${p2}\\\\` : '\\\\'); | ||
} | ||
@@ -47,0 +47,0 @@ return string; |
{ | ||
"name": "jest-regex-util", | ||
"version": "30.0.0-alpha.2", | ||
"version": "30.0.0-alpha.3", | ||
"repository": { | ||
@@ -30,3 +30,3 @@ "type": "git", | ||
}, | ||
"gitHead": "c04d13d7abd22e47b0997f6027886aed225c9ce4" | ||
"gitHead": "e267aff33d105399f2134bad7c8f82285104f3da" | ||
} |
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
4321