(bytes: number)
| 48 | } |
| 49 | |
| 50 | /** ISO `{from, to}` window ending now and reaching `hours` back — the query |
| 51 | * window shape every records/anomalies endpoint expects. */ |
| 52 | export function isoWindow(hours: number): { from: string; to: string } { |
| 53 | const now = new Date() |
| 54 | return { |
| 55 | from: new Date(now.getTime() - hours * 3600 * 1000).toISOString(), |
| 56 | to: now.toISOString() |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | export function formatBytes(bytes: number): string { |
no test coverage detected