This repository has been archived on 2026-03-28. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
StasisWarden-Legacy/node_modules/escape-string-regexp/index.js
T

12 lines
236 B
JavaScript

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