Urara-Blog/node_modules/.pnpm-store/v3/files/8d/4b0bd1c5262c0218624ae89c3c39e4532b076d03bfd46276adb3644082dc89058ec39e37f7ade9d35ead92616367e13909d564335f94765440c29eaffd800e
2022-08-14 01:14:53 +08:00

17 lines
439 B
Text

/** Used to match `RegExp` flags from their coerced string values. */
var reFlags = /\w*$/;
/**
* Creates a clone of `regexp`.
*
* @private
* @param {Object} regexp The regexp to clone.
* @returns {Object} Returns the cloned regexp.
*/
function cloneRegExp(regexp) {
var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
result.lastIndex = regexp.lastIndex;
return result;
}
module.exports = cloneRegExp;