1 | import { bindCallback } from '../util/bindcallback';
|
2 | export async function find(source, predicate, thisArg) {
|
3 | const fn = bindCallback(predicate, thisArg, 2);
|
4 | let i = 0;
|
5 | for await (const item of source) {
|
6 | if (await fn(item, i++)) {
|
7 | return item;
|
8 | }
|
9 | }
|
10 | return undefined;
|
11 | }
|
12 |
|
13 | //# sourceMappingURL=find.mjs.map
|