Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

is-calling-function

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-calling-function - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

19

index.js

@@ -13,14 +13,15 @@ var Walker = require('node-source-walk');

var isFileCallingFunction = false;
var walker = new Walker({
ecmaVersion: 6
});
var walker = new Walker();
walker.walk(source, function(node) {
var isCallExpression = node.type === 'ExpressionStatement' &&
node.expression.type === 'CallExpression';
var callee;
if (node.type === 'ExpressionStatement' &&
node.expression.type === 'CallExpression') {
callee = node.expression.callee;
} else if (node.type === 'CallExpression') {
callee = node.callee;
} else {
return false;
}
if (!isCallExpression) { return; }
var callee = node.expression.callee;
if (!callee) { return; }

@@ -27,0 +28,0 @@

{
"name": "is-calling-function",
"version": "1.0.2",
"version": "1.0.3",
"description": "Whether or not a file is calling a particular function",

@@ -28,3 +28,3 @@ "main": "index.js",

"dependencies": {
"node-source-walk": "~1.4.1"
"node-source-walk": "~2.0.0"
},

@@ -31,0 +31,0 @@ "devDependencies": {

@@ -14,2 +14,6 @@ var assert = require('assert');

it('works for es6', function() {
assert.ok(isCallingFunction('() => foo();', 'foo'));
});
it('works for named iife', function() {

@@ -16,0 +20,0 @@ assert.ok(isCallingFunction('(function foo(){})();', 'foo'));

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