Irina Glushko 2389e7160b HW1 done | 3 gadi atpakaļ | |
---|---|---|
.. | ||
index.js | 3 gadi atpakaļ | |
package.json | 3 gadi atpakaļ | |
readme.md | 3 gadi atpakaļ |
Check whether a variable is a regular expression
$ npm install --save is-regexp
var isRegexp = require('is-regexp');
isRegexp('unicorn');
//=> false
isRegexp(/unicorn/);
//=> true
isRegexp(new RegExp('unicorn'));
//=> true
MIT © Sindre Sorhus