Files
control-pane/public/novnc/node_modules/escape-string-regexp/index.js
Charlie Root 58f2e80eb5 update
2022-07-31 09:56:11 +00: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, '\\$&');
};