UNPKG

230 BJavaScriptView Raw
1export async function count(source, fn = async () => true) {
2 let i = 0;
3 for await (const item of source) {
4 if (await fn(item)) {
5 i++;
6 }
7 }
8 return i;
9}
10
11//# sourceMappingURL=count.mjs.map