Socket
Socket
Sign inDemoInstall

is-regexp

Package Overview
Dependencies
0
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.0 to 2.0.0

license

4

index.js
'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)
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc