MCPcopy
hub / github.com/npmx-dev/npmx.dev / chunkIntoWeeks

Function chunkIntoWeeks

app/utils/charts.ts:18–24  ·  view source on GitHub ↗
(items: T[], weekSize = 7)

Source from the content-addressed store, hash-verified

16}
17
18export function chunkIntoWeeks<T>(items: T[], weekSize = 7): T[][] {
19 const result: T[][] = []
20 for (let index = 0; index < items.length; index += weekSize) {
21 result.push(items.slice(index, index + weekSize))
22 }
23 return result
24}
25
26export function buildWeeklyEvolutionFromDaily(
27 daily: Array<{ day: string; downloads: number }>,

Callers 2

charts.spec.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected