mini-state-machine
Version:
A miniature state machine
8 lines (7 loc) • 344 B
TypeScript
export declare function find<T>(arr: Array<T>, cb: (item: T, index: number) => boolean): T;
export declare function find<T>(arr: Array<T>, cb: (item: T, index: number) => boolean, options: {
index: false;
}): T;
export declare function find<T>(arr: Array<T>, cb: (item: T, index: number) => boolean, options: {
index: true;
}): number;