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

detect-import-require

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

detect-import-require - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

20

index.js

@@ -19,7 +19,7 @@ var acorn = require('acorn')

opts = opts || {}
src = str.toString()
src = src.toString()
var imports = defined(opts.imports, true)
var requires = defined(opts.requires, true)
var results = {

@@ -30,3 +30,3 @@ strings: [],

}
// quick regex test before we parse entire AST

@@ -39,3 +39,3 @@ var regex = regexBoth

}
var ast = acorn.parse(src, {

@@ -55,6 +55,6 @@ ecmaVersion: 6,

}
results.nodes.push(node);
results.nodes.push(node)
}
}
if (requires) {

@@ -70,3 +70,3 @@ callExpression = function (node) {

}
results.nodes.push(node);
results.nodes.push(node)
}

@@ -84,4 +84,4 @@ }

function isRequire (node) {
return node.callee.type === 'Identifier'
&& node.callee.name === 'require'
return node.callee.type === 'Identifier' &&
node.callee.name === 'require'
}
{
"name": "detect-import-require",
"version": "1.0.2",
"version": "1.0.3",
"description": "list require and import paths from a JavaScript source",

@@ -12,2 +12,7 @@ "main": "index.js",

},
"standard": {
"ignore": [
"test/fixtures/**/*.js"
]
},
"dependencies": {

@@ -14,0 +19,0 @@ "acorn": "^2.6.4",

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