(startedAt, finishedAt)
| 252 | } |
| 253 | |
| 254 | function getDurationMs(startedAt, finishedAt) { |
| 255 | const normalizedStartedAt = hydrateDate(startedAt); |
| 256 | const normalizedFinishedAt = hydrateDate(finishedAt); |
| 257 | |
| 258 | if (!normalizedStartedAt || !normalizedFinishedAt) { |
| 259 | return null; |
| 260 | } |
| 261 | |
| 262 | return Math.max(0, normalizedFinishedAt.getTime() - normalizedStartedAt.getTime()); |
| 263 | } |
| 264 | |
| 265 | function emitStructuredAuditLog(action, payload) { |
| 266 | return { action, payload }; |
no test coverage detected