MCPcopy Create free account
hub / github.com/antfu/utils / reduce

Method reduce

src/p.ts:74–76  ·  view source on GitHub ↗
(fn: (previousValue: U, currentValue: Awaited<T>, currentIndex: number, array: Awaited<T>[]) => U, initialValue: U)

Source from the content-addressed store, hash-verified

72 }
73
74 reduce<U>(fn: (previousValue: U, currentValue: Awaited<T>, currentIndex: number, array: Awaited<T>[]) => U, initialValue: U): Promise<U> {
75 return this.promise.then(array => array.reduce(fn, initialValue))
76 }
77
78 clear() {
79 this.promises.clear()

Callers 5

p.test.tsFile · 0.80
uniqueByFunction · 0.80
objectPickFunction · 0.80
unindentFunction · 0.80
sumFunction · 0.80

Calls 1

thenMethod · 0.80

Tested by

no test coverage detected