15 lines
420 B
JavaScript
15 lines
420 B
JavaScript
// Module ID: 10605
|
|
// Function ID: 82670
|
|
// Name: escapeStringRegexp
|
|
// Dependencies: []
|
|
|
|
// Module 10605 (escapeStringRegexp)
|
|
arg5.default = function escapeStringRegexp(str) {
|
|
if ("string" !== typeof str) {
|
|
const _TypeError = TypeError;
|
|
const typeError = new TypeError("Expected a string");
|
|
throw typeError;
|
|
} else {
|
|
return str.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d");
|
|
}
|
|
};
|