is-arrow-function
Advanced tools
Comparing version 1.0.1 to 1.0.2
var toStr = Object.prototype.toString; | ||
var fnToStr = Function.prototype.toString; | ||
var isFnRegex = /^\s*function/; | ||
@@ -7,4 +8,4 @@ module.exports = function isArrowFunction(fn) { | ||
var fnStr = toStr.call(fn); | ||
return fnStr === '[object Function]' && fnToStr.call(fn).indexOf('function') !== 0; | ||
return fnStr === '[object Function]' && !isFnRegex.test(fnToStr.call(fn)); | ||
}; | ||
{ | ||
"name": "is-arrow-function", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Determine if a function is an ES6 arrow function or not.", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "node --harmony test.js" | ||
"test": "node --harmony test/index.js", | ||
"coverage": "covert test/index.js", | ||
"coverage-quiet": "covert test/index.js --quiet" | ||
}, | ||
@@ -29,6 +31,7 @@ "repository": { | ||
"devDependencies": { | ||
"tape": "~2.3.0" | ||
"tape": "~2.14.0", | ||
"covert": "~0.4.0" | ||
}, | ||
"testling": { | ||
"files": "test.js", | ||
"files": "test/index.js", | ||
"browsers": [ | ||
@@ -49,4 +52,7 @@ "iexplore/6.0..latest", | ||
] | ||
}, | ||
"engines": { | ||
"node": ">= 0.4" | ||
} | ||
} | ||
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
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
6194
9
71
0
2