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 2.2.0 to 2.3.0

test/parseopts.js

11

index.js

@@ -24,4 +24,4 @@ var esprima = require('esprima');

var walk = function (src, cb) {
var ast = esprima.parse(src);
var walk = function (src, opts, cb) {
var ast = esprima.parse(src, opts);
traverse(ast, cb);

@@ -36,5 +36,8 @@ };

if (!opts) opts = {};
opts.parse = opts.parse || {};
opts.parse.tolerant = true;
var word = opts.word === undefined ? 'require' : opts.word;
if (typeof src !== 'string') src = String(src);
src = '(function(){' + src.replace(/^#![^\n]*\n/, '') + '\n})()';
src = src.replace(/^#![^\n]*\n/, '');

@@ -55,3 +58,3 @@ var isRequire = opts.isRequire || function (node) {

walk(src, function (node) {
walk(src, opts.parse, function (node) {
if (!isRequire(node)) return;

@@ -58,0 +61,0 @@ if (node.arguments.length

{
"name" : "detective",
"description" : "find all require() calls by walking the AST",
"version" : "2.2.0",
"version" : "2.3.0",
"repository" : {

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

Sorry, the diff of this file is not supported yet

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