Socket
Socket
Sign inDemoInstall

ast-types

Package Overview
Dependencies
Maintainers
1
Versions
172
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ast-types - npm Package Compare versions

Comparing version 0.3.1 to 0.3.2

4

lib/node-path.js

@@ -68,2 +68,6 @@ var assert = require("assert");

NPp.getValueProperty = function(name) {
return types.getFieldValue(this.value, name);
};
NPp.needsParens = function() {

@@ -70,0 +74,0 @@ if (!this.parent)

20

lib/traverse.js

@@ -0,1 +1,2 @@

var assert = require("assert");
var types = require("./types");

@@ -10,2 +11,3 @@ var Node = types.namedTypes.Node;

path.each(traverse);
} else if (Node.check(path.value)) {

@@ -18,7 +20,17 @@ var node = path.value;

// Child paths are cached, so path.parentPath.get(path.name)
// should return the same Path object unless path.replace was
// called during the callback.
path = path.parentPath.get(path.name);
// The node might have been replaced during the callback.
node = path.value;
if (!Node.check(node)) {
return;
}
types.eachField(node, function(name, child) {
// Need to create the child path manually because child
// might not actually be identical to path.value[name],
// if for instance a default field value was substituted.
traverse(new NodePath(child, path, name));
var childPath = path.get(name);
assert.strictEqual(childPath.value, child);
traverse(childPath);
});

@@ -25,0 +37,0 @@ }

@@ -21,3 +21,3 @@ {

],
"version": "0.3.1",
"version": "0.3.2",
"homepage": "http://github.com/benjamn/ast-types",

@@ -33,3 +33,3 @@ "repository": {

"dependencies": {
"ast-path": "~0.1.1"
"ast-path": "~0.1.2"
},

@@ -36,0 +36,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