* The legacy code read `res.body.command[1]` — body.command is an array * shaped `[status, commandString]`. Pull the string out defensively.
(res: FoldrPushResponse | null)
| 316 | * shaped `[status, commandString]`. Pull the string out defensively. |
| 317 | */ |
| 318 | function extractCommand(res: FoldrPushResponse | null): string | undefined { |
| 319 | if (!res) return undefined; |
| 320 | const cmd = res.command; |
| 321 | if (Array.isArray(cmd) && typeof cmd[1] === 'string') return cmd[1]; |
| 322 | if (typeof cmd === 'string') return cmd; |
| 323 | return undefined; |
| 324 | } |