(chunk: string | Uint8Array)
| 120 | |
| 121 | /** Prepend `[<ISO-8601>] ` to a log chunk; unknown chunk types pass through. */ |
| 122 | export function stampLogChunk(chunk: string | Uint8Array): string | Uint8Array { |
| 123 | try { |
| 124 | const stamp = `[${new Date().toISOString()}] `; |
| 125 | if (typeof chunk === 'string') return stamp + chunk; |
| 126 | if (Buffer.isBuffer(chunk)) return Buffer.concat([Buffer.from(stamp), chunk]); |
| 127 | } catch { /* stamping is best-effort; never block the write */ } |
| 128 | return chunk; |
| 129 | } |
| 130 | |
| 131 | /** |
| 132 | * Watchdog `progressPaths` for a server keyed on `root`'s index: the SQLite DB |
no outgoing calls
no test coverage detected