(root: string)
| 75 | } |
| 76 | |
| 77 | export async function readMemoryBundle(root: string): Promise<MemoryBundleSnapshot> { |
| 78 | const directory = await bindMemoryDirectory(root); |
| 79 | if (!directory) return bundleSnapshot(missingDocument(), missingDocument()); |
| 80 | if (await bindTransactionDirectory(directory)) { |
| 81 | throw new MemoryBundleStoreError( |
| 82 | 'io_failed', |
| 83 | 'Memory bundle requires writer recovery before it can be read', |
| 84 | ); |
| 85 | } |
| 86 | return readBoundMemoryBundle(directory); |
| 87 | } |
| 88 | |
| 89 | async function readBoundMemoryBundle(directory: DirectoryBinding): Promise<MemoryBundleSnapshot> { |
| 90 | const memory = await readDocument(directory, 'memory'); |
no test coverage detected