1 | "use strict";
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 | exports.default = replacePathSepForRegex;
|
7 |
|
8 | function _path() {
|
9 | const data = _interopRequireDefault(require("path"));
|
10 |
|
11 | _path = function () {
|
12 | return data;
|
13 | };
|
14 |
|
15 | return data;
|
16 | }
|
17 |
|
18 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
19 |
|
20 | function replacePathSepForRegex(string) {
|
21 | if (_path().default.sep === '\\') {
|
22 | return string.replace(/(\/|(.)?\\(?![[\]{}()*+?.^$|\\]))/g, (_match, _, p2) => p2 && p2 !== '\\' ? p2 + '\\\\' : '\\\\');
|
23 | }
|
24 |
|
25 | return string;
|
26 | } |
\ | No newline at end of file |