github-actions[bot] 08d466b6ab
Add node modules and compiled JavaScript from main (#172)
Co-authored-by: Oliver King <oking3@uncc.edu>
2022-02-09 17:16:49 -05: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, '\\$&');
};