Function
isGeminiSetupCompleteFrame
(message: string | ArrayBuffer | Uint8Array)
Source from the content-addressed store, hash-verified
| 58 | } |
| 59 | |
| 60 | function isGeminiSetupCompleteFrame(message: string | ArrayBuffer | Uint8Array): boolean { |
| 61 | try { |
| 62 | const parsed = JSON.parse(decodeWsText(message)) as unknown |
| 63 | return parsed !== null && typeof parsed === 'object' && 'setupComplete' in (parsed as object) |
| 64 | } catch { |
| 65 | return false |
| 66 | } |
| 67 | } |
| 68 | |
| 69 | const MAX_GEMINI_PENDING_BYTES = 1024 * 1024 // 1 MiB — rejects setup-window floods |
| 70 | function frameByteSize(msg: string | ArrayBuffer | Uint8Array): number { |
Tested by
no test coverage detected