Lists the children of the given node into a new array.
import {listChildren, VariableName} from "estree-sentry";// returns: [// { type: "Identifier", name: "x" },// { type: "Identifier", name: "y" },// ]listChildren({ type: "BinaryExpression", operator: "+", left: { type: "Identifier", name: "x" as VariableName, }, right: { type: "Identifier", name:"y" as VariableName, },}); Copy
import {listChildren, VariableName} from "estree-sentry";// returns: [// { type: "Identifier", name: "x" },// { type: "Identifier", name: "y" },// ]listChildren({ type: "BinaryExpression", operator: "+", left: { type: "Identifier", name: "x" as VariableName, }, right: { type: "Identifier", name:"y" as VariableName, },});
The annotation type.
The parent node.
The children of the parent node.
Lists the children of the given node into a new array.
Example