Skip to content

isRegExp

Returns true for RegExp instances

128 bytes

Usage

Returns true for RegExp instances, even if they are subclass instances or from other realms.

import * as _ from 'radashi'
_.isRegExp(/.+/) // true
_.isRegExp(new RegExp('.+')) // true
_.isRegExp(new (class extends RegExp {})('.+')) // true