UNPKG

@2toad/profanity

Version:

A multi-language profanity filter with full TypeScript support

13 lines 400 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.escapeRegExp = void 0; /** * Escapes all Regular Expression characters in a string * @param text the string to escape * @returns an escaped string */ const escapeRegExp = (text) => { return text.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); }; exports.escapeRegExp = escapeRegExp; //# sourceMappingURL=misc.js.map