@humanwhocodes/momoa
Advanced tools
Comparing version 3.2.0 to 3.2.1
@@ -259,3 +259,11 @@ //----------------------------------------------------------------------------- | ||
type FilterPredicate = (node: Node, index: number, array: Array<Node>) => boolean; | ||
type FilterPredicate = (item: { | ||
node: Node; | ||
parent?: Node; | ||
phase: TraversalPhase; | ||
}, index: number, array: Array<{ | ||
node: Node; | ||
parent?: Node; | ||
phase: TraversalPhase; | ||
}>) => boolean; | ||
type AnyNode = AnyNode$1; | ||
@@ -291,4 +299,4 @@ type JSONValue = JSONValue$1; | ||
*/ | ||
/** @typedef {import("./typedefs").AnyNode} AnyNode */ | ||
/** @typedef {import("./typedefs").JSONValue} JSONValue */ | ||
/** @typedef {import("./typedefs.ts").AnyNode} AnyNode */ | ||
/** @typedef {import("./typedefs.ts").JSONValue} JSONValue */ | ||
/** | ||
@@ -302,5 +310,5 @@ * Evaluates a Momoa AST node into a JavaScript value. | ||
* @callback FilterPredicate | ||
* @param {Node} node | ||
* @param {{node: Node, parent?: Node, phase: TraversalPhase}} item | ||
* @param {number} index | ||
* @param {Array<Node>} array | ||
* @param {Array<{node: Node, parent?: Node, phase: TraversalPhase}>} array | ||
* @returns {boolean} | ||
@@ -313,7 +321,7 @@ */ | ||
* return; | ||
* @returns {IterableIterator<{node:Node,parent:Node|undefined,phase:TraversalPhase}>} An iterator over the AST. | ||
* @returns {IterableIterator<{node: Node, parent?: Node, phase: TraversalPhase}>} An iterator over the AST. | ||
*/ | ||
declare function iterator(root: Node, filter?: FilterPredicate): IterableIterator<{ | ||
node: Node; | ||
parent: Node | undefined; | ||
parent?: Node; | ||
phase: TraversalPhase; | ||
@@ -360,3 +368,3 @@ }>; | ||
*/ | ||
export function document(body: ValueNode$1, parts?: NodeParts$1): DocumentNode$1; | ||
export function document(body: ValueNode, parts?: NodeParts): DocumentNode; | ||
/** | ||
@@ -368,3 +376,3 @@ * Creates a string node. | ||
*/ | ||
export function string(value: string, parts?: NodeParts$1): StringNode$1; | ||
export function string(value: string, parts?: NodeParts): StringNode; | ||
/** | ||
@@ -376,3 +384,3 @@ * Creates a number node. | ||
*/ | ||
export function number(value: number, parts?: NodeParts$1): NumberNode$1; | ||
export function number(value: number, parts?: NodeParts): NumberNode; | ||
/** | ||
@@ -384,3 +392,3 @@ * Creates a boolean node. | ||
*/ | ||
export function boolean(value: boolean, parts?: NodeParts$1): BooleanNode$1; | ||
export function boolean(value: boolean, parts?: NodeParts): BooleanNode; | ||
/** | ||
@@ -391,3 +399,3 @@ * Creates a null node. | ||
*/ | ||
function _null(parts?: NodeParts$1): NullNode$1; | ||
function _null(parts?: NodeParts): NullNode; | ||
export { _null as null }; | ||
@@ -400,3 +408,3 @@ /** | ||
*/ | ||
export function array(elements: ElementNode$1[], parts?: NodeParts$1): ArrayNode$1; | ||
export function array(elements: Array<ElementNode>, parts?: NodeParts): ArrayNode; | ||
/** | ||
@@ -408,3 +416,3 @@ * Creates an element node. | ||
*/ | ||
export function element(value: ValueNode$1, parts?: NodeParts$1): ElementNode$1; | ||
export function element(value: ValueNode, parts?: NodeParts): ElementNode; | ||
/** | ||
@@ -416,3 +424,3 @@ * Creates an object node. | ||
*/ | ||
export function object(members: MemberNode$1[], parts?: NodeParts$1): ObjectNode$1; | ||
export function object(members: Array<MemberNode>, parts?: NodeParts): ObjectNode; | ||
/** | ||
@@ -425,3 +433,3 @@ * Creates a member node. | ||
*/ | ||
export function member(name: StringNode$1 | IdentifierNode$1, value: ValueNode$1, parts?: NodeParts$1): MemberNode$1; | ||
export function member(name: StringNode | IdentifierNode, value: ValueNode, parts?: NodeParts): MemberNode; | ||
/** | ||
@@ -433,3 +441,3 @@ * Creates an identifier node. | ||
*/ | ||
export function identifier(name: string, parts?: NodeParts$1): IdentifierNode$1; | ||
export function identifier(name: string, parts?: NodeParts): IdentifierNode; | ||
/** | ||
@@ -441,3 +449,3 @@ * Creates a NaN node. | ||
*/ | ||
export function nan(sign?: Sign$1, parts?: NodeParts$1): NaNNode$1; | ||
export function nan(sign?: Sign, parts?: NodeParts): NaNNode; | ||
/** | ||
@@ -449,3 +457,3 @@ * Creates an Infinity node. | ||
*/ | ||
export function infinity(sign?: Sign$1, parts?: NodeParts$1): InfinityNode$1; | ||
export function infinity(sign?: Sign, parts?: NodeParts): InfinityNode; | ||
} | ||
@@ -456,5 +464,5 @@ /** | ||
*/ | ||
/** @typedef {import("./typedefs").TraversalPhase} TraversalPhase */ | ||
/** @typedef {import("./typedefs.ts").TraversalPhase} TraversalPhase */ | ||
declare const childKeys: Map<string, string[]>; | ||
export { type AnyNode, type ArrayNode, type BooleanNode, type DocumentNode, type ElementNode, type FilterPredicate, type IdentifierNode, type InfinityNode, type JSONValue, type Location, type MemberNode, type Mode, type NaNNode, type Node, type NodeParts, type NullNode, type NumberNode, type ObjectNode, type ParseOptions, type Range, type Sign, type StringNode, type Token, type TokenType, type TokenizeOptions, type TraversalPhase, type ValueNode, evaluate, iterator, parse, print, tokenize, traverse, types, childKeys as visitorKeys }; |
{ | ||
"name": "@humanwhocodes/momoa", | ||
"version": "3.2.0", | ||
"version": "3.2.1", | ||
"description": "JSON AST parser, tokenizer, printer, traverser.", | ||
@@ -52,3 +52,3 @@ "author": "Nicholas C. Zakas", | ||
"chai": "^4.3.7", | ||
"eslint": "8.36.0", | ||
"eslint": "8.57.0", | ||
"esm": "3.2.25", | ||
@@ -58,3 +58,3 @@ "json-to-ast": "2.1.0", | ||
"mocha": "^10.2.0", | ||
"npm-run-all": "^4.1.5", | ||
"npm-run-all2": "^5.0.0", | ||
"rollup": "^4.19.0", | ||
@@ -64,4 +64,4 @@ "rollup-plugin-copy": "^3.4.0", | ||
"sinon": "^15.0.1", | ||
"typescript": "^4.9.5" | ||
"typescript": "^5.5.4" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
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
206296
4440