MCPcopy
hub / github.com/actions/download-artifact / chunk

Function chunk

src/download-artifact.ts:11–16  ·  view source on GitHub ↗
(arr: T[], n: number)

Source from the content-addressed store, hash-verified

9const PARALLEL_DOWNLOADS = 5
10
11export const chunk = <T>(arr: T[], n: number): T[][] =>
12 arr.reduce((acc, cur, i) => {
13 const index = Math.floor(i / n)
14 acc[index] = [...(acc[index] || []), cur]
15 return acc
16 }, [] as T[][])
17
18export async function run(): Promise<void> {
19 const inputs = {

Callers 1

runFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected