is-regexp
Advanced tools
Comparing version 1.0.0 to 2.0.0
'use strict'; | ||
module.exports = function (re) { | ||
return Object.prototype.toString.call(re) === '[object RegExp]'; | ||
}; | ||
module.exports = input => Object.prototype.toString.call(input) === '[object RegExp]'; |
{ | ||
"name": "is-regexp", | ||
"version": "1.0.0", | ||
"description": "Check whether a variable is a regular expression", | ||
"license": "MIT", | ||
"repository": "sindresorhus/is-regexp", | ||
"author": { | ||
"name": "Sindre Sorhus", | ||
"email": "sindresorhus@gmail.com", | ||
"url": "http://sindresorhus.com" | ||
}, | ||
"engines": { | ||
"node": ">=0.10.0" | ||
}, | ||
"scripts": { | ||
"test": "mocha" | ||
}, | ||
"files": [ | ||
"index.js" | ||
], | ||
"keywords": [ | ||
"regex", | ||
"regexp", | ||
"regular", | ||
"expression", | ||
"regular expression", | ||
"re", | ||
"check", | ||
"type", | ||
"is" | ||
], | ||
"devDependencies": { | ||
"mocha": "*" | ||
} | ||
"name": "is-regexp", | ||
"version": "2.0.0", | ||
"description": "Check if a value is a regular expression", | ||
"license": "MIT", | ||
"repository": "sindresorhus/is-regexp", | ||
"author": { | ||
"name": "Sindre Sorhus", | ||
"email": "sindresorhus@gmail.com", | ||
"url": "sindresorhus.com" | ||
}, | ||
"engines": { | ||
"node": ">=6" | ||
}, | ||
"scripts": { | ||
"test": "xo && ava" | ||
}, | ||
"files": [ | ||
"index.js" | ||
], | ||
"keywords": [ | ||
"regex", | ||
"regexp", | ||
"regular", | ||
"expression", | ||
"regular expression", | ||
"re", | ||
"check", | ||
"type", | ||
"is" | ||
], | ||
"devDependencies": { | ||
"ava": "*", | ||
"xo": "*" | ||
} | ||
} |
# is-regexp [![Build Status](https://travis-ci.org/sindresorhus/is-regexp.svg?branch=master)](https://travis-ci.org/sindresorhus/is-regexp) | ||
> Check whether a variable is a regular expression | ||
> Check if a value is a regular expression | ||
@@ -8,5 +8,5 @@ | ||
```sh | ||
$ npm install --save is-regexp | ||
``` | ||
$ npm install is-regexp | ||
``` | ||
@@ -17,3 +17,3 @@ | ||
```js | ||
var isRegexp = require('is-regexp'); | ||
const isRegexp = require('is-regexp'); | ||
@@ -31,4 +31,9 @@ isRegexp('unicorn'); | ||
## Related | ||
- [is](https://github.com/sindresorhus/is) - Type check values | ||
## License | ||
MIT © [Sindre Sorhus](http://sindresorhus.com) | ||
MIT © [Sindre Sorhus](https://sindresorhus.com) |
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
2311
4
37
2
2