(raw: unknown)
| 91 | * user's decision (accept/decline/cancel) still deserves to reach the server. |
| 92 | */ |
| 93 | const parseResumeContent = (raw: unknown): Record<string, unknown> | undefined => { |
| 94 | if (typeof raw !== "string" || raw === "{}") return undefined; |
| 95 | // oxlint-disable-next-line executor/no-try-catch-or-throw -- boundary: JSON.parse over a value the shell built; a malformed body must not lose the user's answer |
| 96 | try { |
| 97 | // oxlint-disable-next-line executor/no-json-parse -- boundary: the resume content arrives as an opaque JSON string across the shell's postMessage bridge |
| 98 | const parsed: unknown = JSON.parse(raw); |
| 99 | return isRecord(parsed) ? parsed : undefined; |
| 100 | } catch { |
| 101 | return undefined; |
| 102 | } |
| 103 | }; |
| 104 | |
| 105 | const prefersDark = (): boolean => |
| 106 | typeof globalThis.window !== "undefined" && |
no test coverage detected