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

detective

Package Overview
Dependencies
Maintainers
1
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

detective - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

16

index.js

@@ -43,2 +43,18 @@ var burrito = require('burrito');

}
var isDotCallRequire = node.name === 'call'
&& node.value[0][0] === 'dot'
&& node.value[0][1][0] === 'call'
&& node.value[0][1][1][0] === 'name'
&& node.value[0][1][1][1] === 'require'
;
if (isDotCallRequire) {
var expr = node.value[0][1][2][0];
if (expr[0].name === 'string') {
modules.strings.push(expr[1]);
}
else {
modules.expressions.push(burrito.deparse(expr));
}
}
});

@@ -45,0 +61,0 @@

2

package.json
{
"name" : "detective",
"description" : "Find all calls to require() no matter how crazily nested using a proper walk of the AST",
"version" : "0.0.2",
"version" : "0.0.3",
"repository" : {

@@ -6,0 +6,0 @@ "type" : "git",

@@ -12,1 +12,3 @@ var a = require('a');

var y = require('y') * 100;
var EventEmitter2 = require('events2').EventEmitter();

@@ -7,3 +7,3 @@ var assert = require('assert');

exports.single = function () {
assert.deepEqual(detective(src), [ 'a', 'b', 'c', 'events', 'doom', 'y' ]);
assert.deepEqual(detective(src), [ 'a', 'b', 'c', 'events', 'doom', 'y', 'events2' ]);
};
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