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

Method forEach

src/p.ts:70–72  ·  view source on GitHub ↗
(fn: (value: Awaited<T>, index: number) => void)

Source from the content-addressed store, hash-verified

68 }
69
70 forEach(fn: (value: Awaited<T>, index: number) => void): Promise<void> {
71 return this.map(fn).then()
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))

Callers 6

partitionFunction · 0.80
deepMergeFunction · 0.80
deepMergeWithArrayFunction · 0.80
clearUndefinedFunction · 0.80
addMethod · 0.80
batchInvokeFunction · 0.80

Calls 2

mapMethod · 0.95
thenMethod · 0.80

Tested by

no test coverage detected