is-arrow-function
Advanced tools
Comparing version 2.0.1 to 2.0.2
@@ -16,2 +16,4 @@ { | ||
"requireSpaceBetweenArguments": true, | ||
"disallowSpacesInsideParentheses": true, | ||
@@ -18,0 +20,0 @@ |
@@ -0,1 +1,7 @@ | ||
2.0.2 / 2015-01-29 | ||
================== | ||
* Update `tape`, `jscs` | ||
* Bail out early if typeof is not "function". | ||
* Use `is-callable` to remove Object#toString checks. | ||
2.0.1 / 2014-12-15 | ||
@@ -2,0 +8,0 @@ ================== |
'use strict'; | ||
var toStr = Object.prototype.toString; | ||
var isCallable = require('is-callable'); | ||
var fnToStr = Function.prototype.toString; | ||
@@ -10,4 +10,4 @@ var isNonArrowFnRegex = /^\s*function/; | ||
module.exports = function isArrowFunction(fn) { | ||
var typeStr = toStr.call(fn); | ||
var fnStr = typeStr === '[object Function]' ? fnToStr.call(fn) : ''; | ||
if (!isCallable(fn)) { return false; } | ||
var fnStr = fnToStr.call(fn); | ||
return fnStr.length > 0 | ||
@@ -14,0 +14,0 @@ && !isNonArrowFnRegex.test(fnStr) |
{ | ||
"name": "is-arrow-function", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"description": "Determine if a function is an ES6 arrow function or not.", | ||
@@ -30,7 +30,9 @@ "main": "index.js", | ||
}, | ||
"dependencies": {}, | ||
"dependencies": { | ||
"is-callable": "~1.0.3" | ||
}, | ||
"devDependencies": { | ||
"tape": "~3.0.3", | ||
"tape": "~3.4.0", | ||
"covert": "1.0.0", | ||
"jscs": "~1.8.1", | ||
"jscs": "~1.10.0", | ||
"make-arrow-function": "~1.0.0" | ||
@@ -37,0 +39,0 @@ }, |
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
9562
112
1
+ Addedis-callable@~1.0.3
+ Addedis-callable@1.0.4(transitive)