@scalar/api-client
Version:
the open source API testing client
12 lines • 664 B
TypeScript
import type * as monaco from 'monaco-editor';
export type JsonPath = readonly (string | number)[];
/**
* Traverses the AST of a JSON document to find the node at the provided JsonPath.
* Returns undefined if the path does not exist in the AST.
*
* @param node - The root AST node to begin traversal from.
* @param path - The path to traverse within the AST, as an array of keys/indices.
* @returns The AST node at the specified path, or undefined if not found.
*/
export declare const getJsonAstNodeAtPath: (node: monaco.languages.json.ASTNode | undefined, path: JsonPath) => monaco.languages.json.ASTNode | undefined;
//# sourceMappingURL=json-ast.d.ts.map