MCPcopy Create free account
hub / github.com/simstudioai/sim / isStreamBatchEvent

Function isStreamBatchEvent

apps/sim/lib/copilot/request/session/types.ts:20–35  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

18}
19
20export function isStreamBatchEvent(value: unknown): value is StreamBatchEvent {
21 if (!value || typeof value !== 'object') {
22 return false
23 }
24
25 const record = value as Record<string, unknown>
26 if (
27 typeof record.eventId !== 'number' ||
28 !Number.isFinite(record.eventId) ||
29 typeof record.streamId !== 'string'
30 ) {
31 return false
32 }
33
34 return parsePersistedStreamEventEnvelope(record.event).ok
35}

Callers 1

parseStreamSnapshotFunction · 0.90

Calls 1

Tested by

no test coverage detected