jest-regex-util
Advanced tools
Comparing version 20.0.3 to 20.1.0-alpha.1
@@ -1,15 +0,15 @@ | ||
'use strict'; /** | ||
* Copyright (c) 2014, Facebook, Inc. All rights reserved. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. An additional grant | ||
* of patent rights can be found in the PATENTS file in the same directory. | ||
* | ||
* | ||
*/ | ||
'use strict'; | ||
const path = require('path'); | ||
var _path = require('path');var _path2 = _interopRequireDefault(_path);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} | ||
const escapePathForRegex = dir => { | ||
if (path.sep === '\\') { | ||
if (_path2.default.sep === '\\') { | ||
// Replace "\" with "/" so it's not escaped by escapeStrForRegex. | ||
@@ -20,11 +20,11 @@ // replacePathSepForRegex will convert it back. | ||
return replacePathSepForRegex(escapeStrForRegex(dir)); | ||
}; | ||
const escapeStrForRegex = string => | ||
string.replace(/[[\]{}()*+?.\\^$|]/g, '\\$&'); | ||
const replacePathSepForRegex = string => { | ||
if (path.sep === '\\') { | ||
return string.replace(/(\/|\\(?!\.))/g, '\\\\'); | ||
} | ||
}; /** | ||
* Copyright (c) 2014, Facebook, Inc. All rights reserved. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. An additional grant | ||
* of patent rights can be found in the PATENTS file in the same directory. | ||
* | ||
* | ||
*/const escapeStrForRegex = string => string.replace(/[[\]{}()*+?.\\^$|]/g, '\\$&');const replacePathSepForRegex = string => {if (_path2.default.sep === '\\') {return string.replace(/(\/|\\(?!\.))/g, '\\\\');} | ||
return string; | ||
@@ -31,0 +31,0 @@ }; |
{ | ||
"name": "jest-regex-util", | ||
"version": "20.0.3", | ||
"version": "20.1.0-alpha.1", | ||
"repository": { | ||
@@ -9,4 +9,3 @@ "type": "git", | ||
"license": "BSD-3-Clause", | ||
"main": "build/index.js", | ||
"browser": "build-es5/index.js" | ||
"main": "build/index.js" | ||
} |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
1387
3
23
2