si-funciona
Version:
Funciones de utilidad para uso general. [General usage utility functions.]
18 lines (16 loc) • 503 B
JavaScript
Object.defineProperty(exports, '__esModule', {
value: true
})
exports.regexEscape = exports.default = void 0
require('core-js/modules/es.regexp.exec.js')
require('core-js/modules/es.string.replace.js')
/**
* Take a string and escape the regex characters.
* @memberOf module:stringHelpers
* @param {string} str
* @returns {string}
*/
const regexEscape = str => str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
exports.regexEscape = regexEscape
var _default = exports.default = regexEscape