MCPcopy Create free account
hub / github.com/apache/maka / bundleTarget

Function bundleTarget

packages/storage/src/memory-bundle-model.ts:140–152  ·  view source on GitHub ↗
(
  memory: Buffer,
  pending: Buffer | null,
  allowUnsafeMemory = false,
)

Source from the content-addressed store, hash-verified

138}
139
140export 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
154export function bundleSnapshot(
155 memory: MemoryDocumentSnapshot,

Callers 2

commitMemoryBundleFunction · 0.85
restoreMemoryBackupFunction · 0.85

Calls 5

bundleSnapshotFunction · 0.85
snapshotForBytesFunction · 0.85
documentSnapshotFunction · 0.85
missingDocumentFunction · 0.85
fromMethod · 0.80

Tested by

no test coverage detected