Cypress_TS/CyLukTs/lukan/node_modules/escape-string-regexp/index.js
Lukáš Kaňka ea3e372146 údržba
2023-08-15 18:35:50 +02: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, '\\$&');
};