mirror of
https://github.com/fooflington/selfdefined.git
synced 2025-01-23 01:40:10 +00:00
is-regexp
Check whether a variable is a regular expression
Install
$ npm install --save is-regexp
Usage
var isRegexp = require('is-regexp');
isRegexp('unicorn');
//=> false
isRegexp(/unicorn/);
//=> true
isRegexp(new RegExp('unicorn'));
//=> true
License
MIT © Sindre Sorhus