@humanwhocodes/momoa
Advanced tools
Comparing version 3.0.2 to 3.0.3
@@ -13,2 +13,7 @@ //----------------------------------------------------------------------------- | ||
/** | ||
* The phase of the traversal step. | ||
*/ | ||
type TraversalPhase$1 = "enter" | "exit"; | ||
/** | ||
* Tokenization options. | ||
@@ -67,2 +72,3 @@ */ | ||
body: ValueNode$1; | ||
tokens?: Array<Token$1>; | ||
} | ||
@@ -238,2 +244,3 @@ | ||
type ParseOptions = ParseOptions$1; | ||
type TraversalPhase = TraversalPhase$1; | ||
/** | ||
@@ -243,4 +250,4 @@ * @fileoverview Evaluator for Momoa AST. | ||
*/ | ||
/** @typedef {import("./typings").AnyNode} AnyNode */ | ||
/** @typedef {import("./typings").JSONValue} JSONValue */ | ||
/** @typedef {import("./typedefs").AnyNode} AnyNode */ | ||
/** @typedef {import("./typedefs").JSONValue} JSONValue */ | ||
/** | ||
@@ -264,5 +271,9 @@ * Evaluates a Momoa AST node into a JavaScript value. | ||
* return; | ||
* @returns {Iterator} An iterator over the AST. | ||
* @returns {IterableIterator<{node:Node,parent:Node|undefined,phase:TraversalPhase}>} An iterator over the AST. | ||
*/ | ||
declare function iterator(root: Node, filter?: FilterPredicate): Iterator<any, any, undefined>; | ||
declare function iterator(root: Node, filter?: FilterPredicate): IterableIterator<{ | ||
node: Node; | ||
parent: Node | undefined; | ||
phase: TraversalPhase; | ||
}>; | ||
/** | ||
@@ -371,2 +382,2 @@ * | ||
export { AnyNode, ArrayNode, BooleanNode, DocumentNode, ElementNode, FilterPredicate, JSONValue, Location, MemberNode, Mode, Node, NodeParts, NullNode, NumberNode, ObjectNode, ParseOptions, StringNode, Token, TokenType, TokenizeOptions, 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, StringNode, Token, TokenType, TokenizeOptions, TraversalPhase, ValueNode, evaluate, iterator, parse, print, tokenize, traverse, types }; |
@@ -10,3 +10,3 @@ /** | ||
/** @typedef {import("./typings").TokenType} TokenType */ | ||
/** @typedef {import("./typedefs").TokenType} TokenType */ | ||
@@ -69,4 +69,4 @@ //----------------------------------------------------------------------------- | ||
/** @typedef {import("./typings").Location} Location */ | ||
/** @typedef {import("./typings").Token} Token */ | ||
/** @typedef {import("./typedefs").Location} Location */ | ||
/** @typedef {import("./typedefs").Token} Token */ | ||
@@ -159,2 +159,3 @@ //----------------------------------------------------------------------------- | ||
//----------------------------------------------------------------------------- | ||
@@ -164,3 +165,3 @@ // Typedefs | ||
/** @typedef {import("./typings").TokenizeOptions} TokenizeOptions */ | ||
/** @typedef {import("./typedefs").TokenizeOptions} TokenizeOptions */ | ||
@@ -575,13 +576,13 @@ //----------------------------------------------------------------------------- | ||
/** @typedef {import("./typings").NodeParts} NodeParts */ | ||
/** @typedef {import("./typings").DocumentNode} DocumentNode */ | ||
/** @typedef {import("./typings").StringNode} StringNode */ | ||
/** @typedef {import("./typings").NumberNode} NumberNode */ | ||
/** @typedef {import("./typings").BooleanNode} BooleanNode */ | ||
/** @typedef {import("./typings").MemberNode} MemberNode */ | ||
/** @typedef {import("./typings").ObjectNode} ObjectNode */ | ||
/** @typedef {import("./typings").ElementNode} ElementNode */ | ||
/** @typedef {import("./typings").ArrayNode} ArrayNode */ | ||
/** @typedef {import("./typings").NullNode} NullNode */ | ||
/** @typedef {import("./typings").ValueNode} ValueNode */ | ||
/** @typedef {import("./typedefs").NodeParts} NodeParts */ | ||
/** @typedef {import("./typedefs").DocumentNode} DocumentNode */ | ||
/** @typedef {import("./typedefs").StringNode} StringNode */ | ||
/** @typedef {import("./typedefs").NumberNode} NumberNode */ | ||
/** @typedef {import("./typedefs").BooleanNode} BooleanNode */ | ||
/** @typedef {import("./typedefs").MemberNode} MemberNode */ | ||
/** @typedef {import("./typedefs").ObjectNode} ObjectNode */ | ||
/** @typedef {import("./typedefs").ElementNode} ElementNode */ | ||
/** @typedef {import("./typedefs").ArrayNode} ArrayNode */ | ||
/** @typedef {import("./typedefs").NullNode} NullNode */ | ||
/** @typedef {import("./typedefs").ValueNode} ValueNode */ | ||
@@ -727,2 +728,3 @@ //----------------------------------------------------------------------------- | ||
//----------------------------------------------------------------------------- | ||
@@ -732,5 +734,5 @@ // Typedefs | ||
/** @typedef {import("./typings").Node} Node */ | ||
/** @typedef {import("./typings").Mode} Mode */ | ||
/** @typedef {import("./typings").ParseOptions} ParseOptions */ | ||
/** @typedef {import("./typedefs").Node} Node */ | ||
/** @typedef {import("./typedefs").Mode} Mode */ | ||
/** @typedef {import("./typedefs").ParseOptions} ParseOptions */ | ||
@@ -1005,2 +1007,6 @@ //----------------------------------------------------------------------------- | ||
token = next(); | ||
if (!token) { | ||
throw new UnexpectedEOF(members[members.length-1].loc.end); | ||
} | ||
@@ -1150,2 +1156,3 @@ if (token.type === "Comma") { | ||
/** @typedef {import("./typedefs").TraversalPhase} TraversalPhase */ | ||
@@ -1246,3 +1253,3 @@ //----------------------------------------------------------------------------- | ||
* return; | ||
* @returns {Iterator} An iterator over the AST. | ||
* @returns {IterableIterator<{node:Node,parent:Node|undefined,phase:TraversalPhase}>} An iterator over the AST. | ||
*/ | ||
@@ -1274,4 +1281,4 @@ function iterator(root, filter = () => true) { | ||
/** @typedef {import("./typings").AnyNode} AnyNode */ | ||
/** @typedef {import("./typings").JSONValue} JSONValue */ | ||
/** @typedef {import("./typedefs").AnyNode} AnyNode */ | ||
/** @typedef {import("./typedefs").JSONValue} JSONValue */ | ||
@@ -1339,2 +1346,3 @@ //----------------------------------------------------------------------------- | ||
//----------------------------------------------------------------------------- | ||
@@ -1341,0 +1349,0 @@ // Typedefs |
{ | ||
"name": "@humanwhocodes/momoa", | ||
"version": "3.0.2", | ||
"version": "3.0.3", | ||
"description": "JSON AST parser, tokenizer, printer, traverser.", | ||
@@ -5,0 +5,0 @@ "author": "Nicholas C. Zakas", |
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
106345
2581