Home > ts-morph-structures > forEachAugmentedStructureChild
Iterates over the children of a structure (or type structure), or the elements of an array of structures and type structures.
Signature:
export default function forEachAugmentedStructureChild<TStructure>(structureOrArray: ArrayOrValue<StructureImpls | TypeStructures>, callback: (child: StructureImpls | TypeStructures) => TStructure | void): TStructure | undefined;
Parameter | Type | Description |
---|---|---|
structureOrArray | ArrayOrValue<StructureImpls | TypeStructures> | Structure or array of structures to iterate over. |
callback | (child: StructureImpls | TypeStructures) => TStructure | void | Callback to do on each structure, until the callback returns a truthy result. |
Returns:
TStructure | undefined
the first truthy result from the callback.