3.1.0 • Published 2 years ago
is-regexp v3.1.0
is-regexp
Check if a value is a regular expression
Install
$ npm install is-regexp
Usage
import isRegexp from 'is-regexp';
isRegexp('unicorn');
//=> false
isRegexp(/unicorn/);
//=> true
isRegexp(new RegExp('unicorn'));
//=> true
FAQ
Why not just use instanceof
instead of this package?
Related
- is - Type check values