@humanwhocodes/momoa
Advanced tools
Comparing version 3.0.6 to 3.1.1
@@ -377,3 +377,9 @@ //----------------------------------------------------------------------------- | ||
} | ||
/** | ||
* @fileoverview Traversal approaches for Momoa JSON AST. | ||
* @author Nicholas C. Zakas | ||
*/ | ||
/** @typedef {import("./typedefs").TraversalPhase} TraversalPhase */ | ||
declare const childKeys: Map<string, string[]>; | ||
export { AnyNode, ArrayNode, BooleanNode, DocumentNode, ElementNode, FilterPredicate, JSONValue, Location, MemberNode, Mode, Node, NodeParts, NullNode, NumberNode, ObjectNode, ParseOptions, Range, StringNode, Token, TokenType, TokenizeOptions, TraversalPhase, ValueNode, evaluate, iterator, parse, print, tokenize, traverse, types }; | ||
export { AnyNode, ArrayNode, BooleanNode, DocumentNode, ElementNode, FilterPredicate, JSONValue, Location, MemberNode, Mode, Node, NodeParts, NullNode, NumberNode, ObjectNode, ParseOptions, Range, StringNode, Token, TokenType, TokenizeOptions, TraversalPhase, ValueNode, evaluate, iterator, parse, print, tokenize, traverse, types, childKeys as visitorKeys }; |
@@ -1368,2 +1368,2 @@ /** | ||
export { evaluate, iterator, parse, print, tokenize, traverse, types }; | ||
export { evaluate, iterator, parse, print, tokenize, traverse, types, childKeys as visitorKeys }; |
{ | ||
"name": "@humanwhocodes/momoa", | ||
"version": "3.0.6", | ||
"version": "3.1.1", | ||
"description": "JSON AST parser, tokenizer, printer, traverser.", | ||
@@ -5,0 +5,0 @@ "author": "Nicholas C. Zakas", |
@@ -230,2 +230,12 @@ # Momoa JSON | ||
### Visitor Keys | ||
Momoa also exports a map of traversable properties in AST nodes that is helpful if you'd like to traverse an AST manually. This is a map where the keys are the `type` property of each AST node and the values are an array of property names to traverse. | ||
```js | ||
const { visitorKeys } = require("@humanwhocodes/momoa"); | ||
console.log(visitorKeys.get("Document")); // "body" | ||
``` | ||
## Development | ||
@@ -232,0 +242,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
108026
2609
294