This repository has been archived on 2022-03-12. You can view files and clone it, but cannot push or open issues or pull requests.

28 lines
642 B
JavaScript
Raw Normal View History

2021-04-02 02:24:13 +03:00
"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