Files
julia-buildpkg/node_modules/escape-string-regexp/index.js
David Anthoff c0c6ce37ca Add node deps
2019-09-14 21:05:22 -07: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, '\\$&');
};