youtubei.js / JsHelpers / AstVisitObject
Interface: AstVisitObject
Defined in: src/utils/javascript/helpers.ts:28
Methods
enter()?
optionalenter(node,parent,ancestors):AstVisitResult
Defined in: src/utils/javascript/helpers.ts:39
Callback invoked when an AST node is entered.
Parameters
node
Node
Current AST node being visited.
parent
Parent of the current AST node, or null if it's the root.
Node | null
ancestors
Node[]
Array of ancestor nodes, starting from the root down to the parent.
Returns
trueto skip traversing this node's children.WALK_STOPto halt the entire traversal.void/undefinedto continue normal traversal.
leave()?
optionalleave(node,parent,ancestors):AstVisitResult
Defined in: src/utils/javascript/helpers.ts:49
Callback invoked when an AST node is exited.
Parameters
node
Node
Current AST node being exited.
parent
Parent of the current AST node, or null if it's the root.
Node | null
ancestors
Node[]
Array of ancestor nodes, starting from the root down to the parent.
Returns
WALK_STOPto halt the entire traversal.void/undefinedto continue normal traversal.