(seconds: number | string | undefined)
| 212 | * Returns undefined for missing, non-numeric, or non-positive values so the field is omitted. |
| 213 | */ |
| 214 | export function toDurationString(seconds: number | string | undefined): string | undefined { |
| 215 | if (seconds == null || seconds === '') return undefined |
| 216 | const parsed = Number(seconds) |
| 217 | if (!Number.isFinite(parsed) || parsed <= 0) return undefined |
| 218 | return `${parsed}s` |
| 219 | } |
| 220 | |
| 221 | /** |
| 222 | * Maps a raw `WorkflowExecutionInfo` to the flat execution summary shared by the |
no outgoing calls
no test coverage detected