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

abstract-syntax-tree

Package Overview
Dependencies
Maintainers
2
Versions
67
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

abstract-syntax-tree - npm Package Compare versions

Comparing version 2.5.0 to 2.6.0

14

package.json
{
"name": "abstract-syntax-tree",
"version": "2.5.0",
"version": "2.6.0",
"description": "abstract syntax tree",

@@ -9,5 +9,3 @@ "main": "index.js",

"lint": "standard",
"benchmark": "ava test/benchmarks/*.js",
"coverage": "nyc npm test",
"coverage:report": "nyc --reporter=text-lcov npm test > coverage.lcov && codecov"
"coverage": "nyc npm test"
},

@@ -37,7 +35,5 @@ "engines": {

"devDependencies": {
"ava": "^2.4.0",
"benchmark": "^2.1.4",
"codecov": "^3.6.1",
"nyc": "^14.1.1",
"standard": "^13.0.2"
"ava": "^3.5.0",
"nyc": "^15.0.0",
"standard": "^14.3.1"
},

@@ -44,0 +40,0 @@ "dependencies": {

@@ -165,9 +165,7 @@ # abstract-syntax-tree

const tree = parse(source)
replace(tree, {
enter (node) {
if (node.type === 'VariableDeclaration') {
node.kind = 'let'
}
return node
replace(tree, node => {
if (node.type === 'VariableDeclaration') {
node.kind = 'let'
}
return node
})

@@ -174,0 +172,0 @@ ```

@@ -19,6 +19,8 @@ const estraverse = require('estraverse')

module.exports = function replace (tree, options) {
const enter = typeof options === 'function' ? options : options.enter
const leave = options && options.leave
return estraverse.replace(tree, {
enter (node, parent) {
if (options.enter) {
const replacement = complexReplace(options.enter, node, parent)
if (enter) {
const replacement = complexReplace(enter, node, parent)
if (replacement) { return replacement }

@@ -28,4 +30,4 @@ }

leave (node, parent) {
if (options.leave) {
const replacement = complexReplace(options.leave, node, parent)
if (leave) {
const replacement = complexReplace(leave, node, parent)
if (replacement) { return replacement }

@@ -32,0 +34,0 @@ }

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