Socket
Socket
Sign inDemoInstall

node-source-walk

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-source-walk - npm Package Compare versions

Comparing version 3.0.1 to 3.0.2

46

index.js
var babylon = require('babylon');
var assign = require('object-assign');

@@ -8,22 +7,22 @@ /**

module.exports = function(options) {
this.options = assign({
plugins: [
'jsx',
'flow',
'asyncFunctions',
'classConstructorCall',
'doExpressions',
'trailingFunctionCommas',
'objectRestSpread',
'decorators',
'classProperties',
'exportExtensions',
'exponentiationOperator',
'asyncGenerators',
'functionBind',
'functionSent'
],
sourceType: 'module'
}, options);
this.options = options || {};
this.options.plugins = this.options.plugins || [
'jsx',
'flow',
'asyncFunctions',
'classConstructorCall',
'doExpressions',
'trailingFunctionCommas',
'objectRestSpread',
'decorators',
'classProperties',
'exportExtensions',
'exponentiationOperator',
'asyncGenerators',
'functionBind',
'functionSent'
];
this.options.sourceType = this.options.sourceType || 'module';
// We use global state to stop the recursive traversal of the AST

@@ -58,9 +57,10 @@ this.shouldStop = false;

if (Array.isArray(node)) {
node.forEach(function(x) {
for (var i = 0, l = node.length; i < l; i++) {
var x = node[i];
if (x !== null) {
// Mark that the node has been visited
x.parent = node;
that.traverse(x, cb);
this.traverse(x, cb);
}
});
}

@@ -67,0 +67,0 @@ } else if (node && typeof node === 'object') {

{
"name": "node-source-walk",
"version": "3.0.1",
"version": "3.0.2",
"description": "Execute a callback on every node of a source code's AST and stop walking when you see fit",

@@ -29,4 +29,3 @@ "main": "index.js",

"dependencies": {
"babylon": "~6.8.1",
"object-assign": "^4.0.1"
"babylon": "~6.8.1"
},

@@ -33,0 +32,0 @@ "devDependencies": {

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