(string: string)
| 21 | string.replaceAll(/[$()*+.?[\\\]^{|}]/g, '\\$&'); |
| 22 | |
| 23 | export const replacePathSepForRegex = (string: string): string => { |
| 24 | if (sep === '\\') { |
| 25 | return string.replaceAll( |
| 26 | /(\/|(.)?\\(?![$()*+.?[\\\]^{|}]))/g, |
| 27 | (_match, _, p2) => (p2 && p2 !== '\\' ? `${p2}\\\\` : '\\\\'), |
| 28 | ); |
| 29 | } |
| 30 | return string; |
| 31 | }; |
no outgoing calls
no test coverage detected