_baseIsRegExp.js 509 B

123456789101112131415161718
  1. import baseGetTag from './_baseGetTag.js';
  2. import isObjectLike from './isObjectLike.js';
  3. /** `Object#toString` result references. */
  4. var regexpTag = '[object RegExp]';
  5. /**
  6. * The base implementation of `_.isRegExp` without Node.js optimizations.
  7. *
  8. * @private
  9. * @param {*} value The value to check.
  10. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  11. */
  12. function baseIsRegExp(value) {
  13. return isObjectLike(value) && baseGetTag(value) == regexpTag;
  14. }
  15. export default baseIsRegExp;