UNPKG
hexo-util
Version:
latest (3.3.0)
legacy (1.9.1)
3.3.0
3.2.0
3.1.0
3.0.1
3.0.0
2.7.0
2.6.1
2.6.0
2.5.0
2.4.0
2.3.0
2.2.0
2.1.0
2.0.0
1.9.1
1.9.0
1.8.1
1.8.0
1.7.0
1.6.1
1.6.0
1.5.0
1.4.0
1.3.1
1.3.0
1.2.0
1.1.0
1.0.1
1.0.0
1.0.0-rc3
1.0.0-rc2
1.0.0-rc1
0.6.3
0.6.2
0.6.1
0.6.0
0.5.3
0.5.2
0.5.1
0.5.0
0.4.1
0.4.0
0.3.0
0.2.1
0.2.0
0.1.7
0.1.6
0.1.5
0.1.4
0.1.3
0.1.2
0.1.1
0.1.0
0.0.2
0.0.1
Utilities for Hexo.
hexo.io
hexojs/hexo-util
hexo-util
/
dist
/
escape_regexp.js
9 lines
•
303 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
"use strict"
;
function
escapeRegExp
(
str
) {
if
(
typeof
str !==
'string'
)
throw
new
TypeError
(
'str must be a string!'
);
// http://stackoverflow.com/a/6969486
return
str.
replace
(
/[-[\]/{}()*+?.\\^$|]/g
,
'\\$&'
); }
module
.
exports
= escapeRegExp;
//# sourceMappingURL=escape_regexp.js.map