ast-monkey-traverse
Version:
Utility library to traverse AST
21 lines (19 loc) • 463 B
TypeScript
declare const version: string;
interface Stop {
now: boolean;
}
interface InnerObj {
depth: number;
path: string;
topmostKey: string;
parent: any;
parentType: string;
parentKey: string | null;
}
type Callback = (key: string, val: any, innerObj: InnerObj, stop: Stop) => any;
/**
* Utility library to traverse AST
*/
declare function traverse<T>(tree1: T, cb1: Callback): T;
export { traverse, version };
export type { Callback, InnerObj, Stop };