Files
ccc-obfuscated-code/node_modules/escape-string-regexp/index.js
Pipi Chen b8a3516cd6 update
2020-05-07 01:02:44 +08:00

12 lines
226 B
JavaScript

'use strict';
var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g;
module.exports = function (str) {
if (typeof str !== 'string') {
throw new TypeError('Expected a string');
}
return str.replace(matchOperatorsRe, '\\$&');
};