Files
cssd-back/node_modules/escape-string-regexp/index.js
T
2019-07-15 13:07:31 +04:30

12 lines
226 B
JavaScript
Vendored

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