(value: unknown)
| 18 | } |
| 19 | |
| 20 | export 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 | } |
no test coverage detected