ts-morph-structures

Home > ts-morph-structures > forEachAugmentedStructureChild

forEachAugmentedStructureChild() function

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;

Parameters

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.