(value: unknown)
| 81 | } |
| 82 | |
| 83 | function parseScopeRecordMap(value: unknown): Record<string, EventsScopeEntry> { |
| 84 | if (typeof value !== 'object' || value === null) { |
| 85 | return {}; |
| 86 | } |
| 87 | const out: Record<string, EventsScopeEntry> = {}; |
| 88 | for (const [scopeId, entry] of Object.entries(value)) { |
| 89 | if ( |
| 90 | entry && |
| 91 | typeof entry === 'object' && |
| 92 | typeof (entry as { lastEventId?: unknown }).lastEventId === 'string' |
| 93 | ) { |
| 94 | out[scopeId] = { lastEventId: (entry as { lastEventId: string }).lastEventId }; |
| 95 | } |
| 96 | } |
| 97 | return out; |
| 98 | } |
| 99 | |
| 100 | function parseEventsDocument(content: string): EventsScopes { |
| 101 | try { |
no outgoing calls
no test coverage detected