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.3 to 0.0.4

test/files/word.js

17

index.js
var burrito = require('burrito');
var exports = module.exports = function (src) {
return exports.find(src).strings;
var exports = module.exports = function (src, opts) {
return exports.find(src, opts).strings;
};
exports.find = function (src) {
exports.find = function (src, opts) {
if (!opts) opts = {};
var word = opts.word === undefined ? 'require' : opts.word;
var modules = { strings : [], expressions : [] };
if (src.toString().indexOf('require') == -1) return modules;
if (src.toString().indexOf(word) == -1) return modules;

@@ -15,3 +18,3 @@ burrito(src, function (node) {

&& node.value[0][0] === 'name'
&& node.value[0][1] === 'require'
&& node.value[0][1] === word
;

@@ -32,3 +35,3 @@ if (isRequire) {

&& node.value[0][1][0] === 'name'
&& node.value[0][1][1] === 'require'
&& node.value[0][1][1] === word
;

@@ -50,3 +53,3 @@

&& node.value[0][1][1][0] === 'name'
&& node.value[0][1][1][1] === 'require'
&& node.value[0][1][1][1] === word
;

@@ -53,0 +56,0 @@ if (isDotCallRequire) {

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

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

Sorry, the diff of this file is not supported yet

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