Socket
Socket
Sign inDemoInstall

estree-walker

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

estree-walker - npm Package Compare versions

Comparing version 0.6.0 to 0.6.1

5

CHANGELOG.md
# changelog
## 0.6.1
* Only traverse nodes that exist and have a type ([#9](https://github.com/Rich-Harris/estree-walker/pull/9))
* Only cache keys for nodes with a type ([#8](https://github.com/Rich-Harris/estree-walker/pull/8))
## 0.6.0

@@ -4,0 +9,0 @@

4

dist/estree-walker.umd.js

@@ -35,3 +35,3 @@ (function (global, factory) {

const keys = childKeys[node.type] || (
const keys = node.type && childKeys[node.type] || (
childKeys[node.type] = Object.keys(node).filter(key => typeof node[key] === 'object')

@@ -46,3 +46,3 @@ );

for (let j = 0; j < value.length; j += 1) {
visit(value[j], node, enter, leave, key, j);
value[j] && value[j].type && visit(value[j], node, enter, leave, key, j);
}

@@ -49,0 +49,0 @@ }

{
"name": "estree-walker",
"description": "Traverse an ESTree-compliant AST",
"version": "0.6.0",
"version": "0.6.1",
"author": "Rich Harris",

@@ -6,0 +6,0 @@ "license": "MIT",

@@ -19,9 +19,9 @@ # estree-walker

ast = acorn.parse( sourceCode, options ); // https://github.com/marijnh/acorn
ast = acorn.parse( sourceCode, options ); // https://github.com/acornjs/acorn
walk( ast, {
enter: function ( node, parent ) {
enter: function ( node, parent, prop, index ) {
// some code happens
},
leave: function ( node, parent ) {
leave: function ( node, parent, prop, index ) {
// some code happens

@@ -46,2 +46,2 @@ }

MIT
MIT

@@ -29,3 +29,3 @@ export function walk(ast, { enter, leave }) {

const keys = childKeys[node.type] || (
const keys = node.type && childKeys[node.type] || (
childKeys[node.type] = Object.keys(node).filter(key => typeof node[key] === 'object')

@@ -40,3 +40,3 @@ );

for (let j = 0; j < value.length; j += 1) {
visit(value[j], node, enter, leave, key, j);
value[j] && value[j].type && visit(value[j], node, enter, leave, key, j);
}

@@ -43,0 +43,0 @@ }

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