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

Function documentSnapshot

packages/storage/src/memory-bundle-model.ts:194–204  ·  view source on GitHub ↗
(
  bytes: Uint8Array,
  documentRevision: MemoryRevision = revision(bytes),
)

Source from the content-addressed store, hash-verified

192}
193
194export 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
206export function missingDocument(): Extract<MemoryDocumentSnapshot, { kind: 'missing' }> {
207 return { kind: 'missing', revision: null, byteLength: 0 };

Callers 2

bundleTargetFunction · 0.85
snapshotForBytesFunction · 0.85

Calls 2

fromMethod · 0.80
revisionFunction · 0.70

Tested by

no test coverage detected