# isRegExp
# Description
检查 value 是否为 RegExp 对象。
# Params
value
# Return
Boolean
# Depend
import getTag from './.internal/getTag.js'
import isObjectLike from './isObjectLike.js'
import nodeTypes from './.internal/nodeTypes.js'
# Code
const nodeIsRegExp = nodeTypes && nodeTypes.isRegExp
const isRegExp = nodeIsRegExp
? (value) => nodeIsRegExp(value)
: (value) => isObjectLike(value) && getTag(value) == '[object RegExp]'
# Analyze
和 isArrayBuffer 类似,具体不在赘述
# Example
isRegExp(/abc/)
// => true
isRegExp('/abc/')
// => false
← isPlainObject isSet →