(value: unknown, label: string)
| 112 | }; |
| 113 | |
| 114 | const serializeJson = (value: unknown, label: string): string | undefined => { |
| 115 | if (typeof value === "undefined") { |
| 116 | return undefined; |
| 117 | } |
| 118 | |
| 119 | try { |
| 120 | return JSON.stringify(value); |
| 121 | } catch (cause) { |
| 122 | throw new Error(`${label} is not JSON serializable: ${toError(cause).message}`); |
| 123 | } |
| 124 | }; |
| 125 | |
| 126 | const looksLikeInterruptedError = (message: string): boolean => /\binterrupted\b/i.test(message); |
| 127 |
no test coverage detected