(value: unknown, label: string)
| 93 | }; |
| 94 | |
| 95 | const serializeJson = (value: unknown, label: string): string | undefined => { |
| 96 | if (typeof value === "undefined") { |
| 97 | return undefined; |
| 98 | } |
| 99 | |
| 100 | try { |
| 101 | return JSON.stringify(value); |
| 102 | } catch (cause) { |
| 103 | throw new Error(`${label} is not JSON serializable: ${toError(cause).message}`); |
| 104 | } |
| 105 | }; |
| 106 | |
| 107 | const looksLikeInterruptedError = (message: string): boolean => /\binterrupted\b/i.test(message); |
| 108 |
no test coverage detected