You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
636 B

"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = replacePathSepForRegex;
function _path() {
const data = _interopRequireDefault(require("path"));
_path = function () {
return data;
};
return data;
}
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function replacePathSepForRegex(string) {
if (_path().default.sep === '\\') {
return string.replace(/(\/|(.)?\\(?![[\]{}()*+?.^$|\\]))/g, (_match, _, p2) => p2 && p2 !== '\\' ? p2 + '\\\\' : '\\\\');
}
return string;
}
//# sourceMappingURL=replacePathSepForRegex.js.map