MCPcopy Create free account
hub / github.com/arktypeio/arktype / addSnapshot

Method addSnapshot

ark/aot/cache.ts:215–220  ·  view source on GitHub ↗
(snapshot: Snapshot)

Source from the content-addressed store, hash-verified

213
214 // named by its content, so a build writing it again writes the same file
215 addSnapshot(snapshot: Snapshot): string {
216 const text = JSON.stringify(snapshot)
217 const id = hashOf(text)
218 this.write(`s-${id}`, text)
219 return id
220 }
221
222 // one cut short or changed since it was written reads as missing, and is
223 // written again

Callers 1

snapshotOfFunction · 0.80

Calls 2

writeMethod · 0.95
hashOfFunction · 0.70

Tested by

no test coverage detected