Socket
Socket
Sign inDemoInstall

is-arrow-function

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-arrow-function - npm Package Compare versions

Comparing version 2.0.1 to 2.0.2

2

.jscs.json

@@ -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 @@ ==================

6

index.js
'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 @@ },

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc