abstract-syntax-tree
Advanced tools
Comparing version 2.9.4 to 2.9.5
# 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) |
{ | ||
"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 |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
74321
126
1417
836