/
githubmirror
/
lodash
Обзор
Документация
Войти
/
githubmirror
/
lodash
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
4.18.0-amd
_cloneRegExp.js
20 строк
488 B
John-David Dalton
Bump to v4.6.0.
01 мар 2016, 10:38
01 мар 2016, 10:38
8166b65
Код
Авторство
О чём код?
define([], function() { /** 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; } return cloneRegExp; });