MCPcopy
hub / github.com/anomalyco/opencode / toInterval

Function toInterval

packages/console/function/src/stat.ts:14–20  ·  view source on GitHub ↗
(date: Date)

Source from the content-addressed store, hash-verified

12 if (ids.length === 0) return Response.json({} satisfies Result)
13
14 const toInterval = (date: Date) =>
15 parseInt(
16 date
17 .toISOString()
18 .replace(/[^0-9]/g, "")
19 .substring(0, 12),
20 )
21 const now = Date.now()
22 const intervals = Array.from({ length: 30 }, (_, i) => toInterval(new Date(now - i * 60 * 1000)))
23

Callers 1

fetchFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected