UNPKG
@stream-io/escape-string-regexp
Version:
latest (5.0.1)
5.0.1
Escape RegExp special characters
sindresorhus/escape-string-regexp
@stream-io/escape-string-regexp
/
dist
/
index.modern.js
3 lines
(2 loc)
•
209 B
JavaScript
View Raw
1
2
3
function
e
(
e
){
if
(
"string"
!=
typeof
e)
throw
new
TypeError
(
"Expected a string"
);
return
e.
replace
(
/[|\\{}()[\]^$+*?.]/g
,
"\\$&"
).
replace
(
/-/g
,
"\\x2d"
)}
export
{e
as
default
};
//# sourceMappingURL=index.modern.js.map