Comparing version 1.0.0 to 1.0.1
12
index.js
@@ -1,9 +0,13 @@ | ||
"use strict"; | ||
'use strict'; | ||
var _toString = Object.prototype.toString; | ||
var regexType = '[object RegExp]'; | ||
var regexExec = RegExp.prototype.exec; | ||
module.exports = function isRegex(value) { | ||
return _toString.call(value) === regexType; | ||
try { | ||
regexExec.call(value); | ||
return true; | ||
} catch (e) { | ||
return false; | ||
} | ||
}; | ||
{ | ||
"name": "is-regex", | ||
"version": "1.0.0", | ||
"description": "Is this value a JS regex?", | ||
"version": "1.0.1", | ||
"description": "Is this value a JS regex? Works cross-realm/iframe, and despite ES6 @@toStringTag", | ||
"author": "Jordan Harband", | ||
@@ -9,5 +9,6 @@ "license": "MIT", | ||
"scripts": { | ||
"test": "node test.js && npm run coverage-quiet", | ||
"test": "npm run lint && node test.js && npm run coverage-quiet", | ||
"coverage": "covert test.js", | ||
"coverage-quiet": "covert test.js --quiet" | ||
"coverage-quiet": "covert test.js --quiet", | ||
"lint": "jscs *.js" | ||
}, | ||
@@ -32,4 +33,5 @@ "repository": { | ||
"devDependencies": { | ||
"tape": "~2.13.1", | ||
"covert": "~0.4.0" | ||
"tape": "~3.4.0", | ||
"covert": "1.0.0", | ||
"jscs": "~1.10.0" | ||
}, | ||
@@ -36,0 +38,0 @@ "testling": { |
#is-regex <sup>[![Version Badge][2]][1]</sup> | ||
[![Build Status][3]][4] [![dependency status][5]][6] [![dev dependency status][7]][8] | ||
[![Build Status][3]][4] | ||
[![dependency status][5]][6] | ||
[![dev dependency status][7]][8] | ||
[![License][license-image]][license-url] | ||
[![Downloads][downloads-image]][downloads-url] | ||
@@ -10,2 +14,3 @@ [![npm badge][11]][1] | ||
Is this value a JS regex? | ||
This module works cross-realm/iframe, and despite ES6 @@toStringTag. | ||
@@ -37,7 +42,7 @@ ## Example | ||
[2]: http://vb.teelaun.ch/ljharb/is-regex.svg | ||
[3]: https://travis-ci.org/ljharb/is-regex.png | ||
[3]: https://travis-ci.org/ljharb/is-regex.svg | ||
[4]: https://travis-ci.org/ljharb/is-regex | ||
[5]: https://david-dm.org/ljharb/is-regex.png | ||
[5]: https://david-dm.org/ljharb/is-regex.svg | ||
[6]: https://david-dm.org/ljharb/is-regex | ||
[7]: https://david-dm.org/ljharb/is-regex/dev-status.png | ||
[7]: https://david-dm.org/ljharb/is-regex/dev-status.svg | ||
[8]: https://david-dm.org/ljharb/is-regex#info=devDependencies | ||
@@ -47,2 +52,6 @@ [9]: https://ci.testling.com/ljharb/is-regex.png | ||
[11]: https://nodei.co/npm/is-regex.png?downloads=true&stars=true | ||
[license-image]: http://img.shields.io/npm/l/is-regex.svg | ||
[license-url]: LICENSE | ||
[downloads-image]: http://img.shields.io/npm/dm/is-regex.svg | ||
[downloads-url]: http://npm-stat.com/charts.html?package=is-regex | ||
@@ -1,2 +0,2 @@ | ||
"use strict"; | ||
'use strict'; | ||
@@ -3,0 +3,0 @@ var test = require('tape'); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7245
8
71
55
3