( bytes: Uint8Array, documentRevision: MemoryRevision = revision(bytes), )
| 192 | } |
| 193 | |
| 194 | export function documentSnapshot( |
| 195 | bytes: Uint8Array, |
| 196 | documentRevision: MemoryRevision = revision(bytes), |
| 197 | ): Extract<MemoryDocumentSnapshot, { kind: 'document' }> { |
| 198 | return { |
| 199 | kind: 'document', |
| 200 | revision: documentRevision, |
| 201 | byteLength: bytes.byteLength, |
| 202 | bytes: Uint8Array.from(bytes), |
| 203 | }; |
| 204 | } |
| 205 | |
| 206 | export function missingDocument(): Extract<MemoryDocumentSnapshot, { kind: 'missing' }> { |
| 207 | return { kind: 'missing', revision: null, byteLength: 0 }; |
no test coverage detected