(raw: string | undefined)
| 149 | } |
| 150 | |
| 151 | function safeJsonParse(raw: string | undefined): unknown { |
| 152 | if (!raw) return undefined |
| 153 | try { |
| 154 | return JSON.parse(raw) |
| 155 | } catch { |
| 156 | return undefined |
| 157 | } |
| 158 | } |
| 159 | |
| 160 | function isRecord(value: unknown): value is Record<string, unknown> { |
| 161 | return typeof value === 'object' && value !== null && !Array.isArray(value) |
no test coverage detected