您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

isRegExp.js 646B

123456789101112131415161718192021222324252627
  1. var baseIsRegExp = require('./_baseIsRegExp'),
  2. baseUnary = require('./_baseUnary'),
  3. nodeUtil = require('./_nodeUtil');
  4. /* Node.js helper references. */
  5. var nodeIsRegExp = nodeUtil && nodeUtil.isRegExp;
  6. /**
  7. * Checks if `value` is classified as a `RegExp` object.
  8. *
  9. * @static
  10. * @memberOf _
  11. * @since 0.1.0
  12. * @category Lang
  13. * @param {*} value The value to check.
  14. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  15. * @example
  16. *
  17. * _.isRegExp(/abc/);
  18. * // => true
  19. *
  20. * _.isRegExp('/abc/');
  21. * // => false
  22. */
  23. var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
  24. module.exports = isRegExp;