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.9.4 to 2.9.5

src/match.js

4

CHANGELOG.md
# abstract-syntax-tree changelog
## 2.9.5
* add: new match method
## 2.8.1

@@ -4,0 +8,0 @@

@@ -18,2 +18,3 @@ const find = require('./src/find')

const template = require('./src/template')
const match = require('./src/match')
const serialize = require('./src/serialize')

@@ -65,2 +66,6 @@ const sourcemap = require('./src/sourcemap')

static match (node, selector) {
return match(node, selector)
}
static generate (tree, options) {

@@ -67,0 +72,0 @@ return generate(tree, options)

2

package.json
{
"name": "abstract-syntax-tree",
"version": "2.9.4",
"version": "2.9.5",
"description": "abstract syntax tree",

@@ -5,0 +5,0 @@ "main": "index.js",

# abstract-syntax-tree
[![npm](https://img.shields.io/npm/v/abstract-syntax-tree.svg)](https://www.npmjs.com/package/abstract-syntax-tree) [![build](https://github.com/buxlabs/abstract-syntax-tree/workflows/build/badge.svg)](https://github.com/buxlabs/abstract-syntax-tree/actions)
[![npm](https://img.shields.io/npm/v/abstract-syntax-tree.svg)](https://www.npmjs.com/package/abstract-syntax-tree) [![build](https://github.com/buxlabs/abstract-syntax-tree/workflows/build/badge.svg)](https://github.com/buxlabs/abstract-syntax-tree/actions)

@@ -211,3 +211,3 @@ > A library for working with abstract syntax trees.

// if (node.type === 'Literal' && node.value === 'use strict') return null
// return node
// return node
// })

@@ -350,2 +350,11 @@

#### match
```js
const { match } = require('abstract-syntax-tree')
console.log(match({ type: 'Literal', value: 42 }, 'Literal[value=42]')) // true
console.log(match({ type: 'Literal', value: 41 }, 'Literal[value=42]')) // false
````
#### template

@@ -361,3 +370,3 @@

Almost all of the static methods (excluding parse, generate, template and equal) have their instance equivalents. There are few extra instance methods:
Almost all of the static methods (excluding parse, generate, template and match) have their instance equivalents. There are few extra instance methods:

@@ -364,0 +373,0 @@ #### mark

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