UNPKG

269 BJavaScriptView Raw
1import { identityAsync } from '../util/identity';
2export async function sum(source, selector = identityAsync) {
3 let value = 0;
4 for await (const item of source) {
5 value += await selector(item);
6 }
7 return value;
8}
9
10//# sourceMappingURL=sum.mjs.map