UNPKG

util-ex

Version:

Browser-friendly enhanced util fully compatible with standard node.js

11 lines (10 loc) 328 B
/** * create or clone RegExp * @param {string|RegExp} value - create a new RegExp from. * @returns {RegExp} - new RegExp instance. * @example * toRegExp('/[a-z]/g') // new RegExp(/[a-z]/g) * toRegExp(/[a-z]/g) // new RegExp(/[a-z]/g) */ export function toRegExp(value: string | RegExp): RegExp; export default toRegExp;