UNPKG

@studiohyperdrive/utils

Version:
10 lines (9 loc) 381 B
/** * Searches recursively over a nested list of items. * * @param list - The list of items we want to loop over recursively * @param callbackFn - The method we use for checking each item for a match */ export declare const searchRecursively: <ItemType extends { children: ItemType[]; }>(list: ItemType[], callbackFn: (item: ItemType) => boolean) => ItemType | undefined;