MCPcopy Create free account
hub / github.com/ProtonDriveApps/sdk / parseScopeRecordMap

Function parseScopeRecordMap

cli/src/events/storage.ts:83–98  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

81}
82
83function 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
100function parseEventsDocument(content: string): EventsScopes {
101 try {

Callers 1

parseEventsDocumentFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected