@naverpay/hidash
Version:
improved lodash
14 lines (12 loc) • 490 B
TypeScript
type Predicate<T> = ((item: T) => boolean) | string | number | object | (string | number)[];
/**
* @description
* Iterates over elements of collection, return first matched element
*
* @param {Array|Object} collection collection to find.
* @param {Function} predicate function invoked per iteration.
*
* @return Returns the matched element.
*/
declare function find<T = unknown>(collection: T[] | object, predicate?: Predicate<T>): T | undefined;
export { find as default, find };