( memory: Buffer, pending: Buffer | null, allowUnsafeMemory = false, )
| 138 | } |
| 139 | |
| 140 | export function bundleTarget( |
| 141 | memory: Buffer, |
| 142 | pending: Buffer | null, |
| 143 | allowUnsafeMemory = false, |
| 144 | ): MemoryBundleTarget { |
| 145 | const memoryBytes = Buffer.from(memory); |
| 146 | const pendingBytes = pending === null ? null : Buffer.from(pending); |
| 147 | const snapshot = bundleSnapshot( |
| 148 | allowUnsafeMemory ? snapshotForBytes(memoryBytes) : documentSnapshot(memoryBytes), |
| 149 | pendingBytes === null ? missingDocument() : documentSnapshot(pendingBytes), |
| 150 | ); |
| 151 | return { snapshot, memory: memoryBytes, pending: pendingBytes }; |
| 152 | } |
| 153 | |
| 154 | export function bundleSnapshot( |
| 155 | memory: MemoryDocumentSnapshot, |
no test coverage detected