$ npm install is-regexp
Check if a value is a regular expression
$ npm install is-regexp
import isRegexp from 'is-regexp';
isRegexp('unicorn');
//=> false
isRegexp(/unicorn/);
//=> true
isRegexp(new RegExp('unicorn'));
//=> true
instanceof
instead of this package?© 2010 - cnpmjs.org x YWFE | Home | YWFE