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

Function writeAll

ark/aot/shadow.ts:641–650  ·  view source on GitHub ↗
(call: Writes, counterparts: Map<object, unknown>)

Source from the content-addressed store, hash-verified

639
640// e.g. an in-place morph's, through its arguments or what it returned
641const writeAll = (call: Writes, counterparts: Map<object, unknown>) => {
642 relate(counterparts, call.copiedAfter)
643 if (!call.written.length) return
644 // e.g. not ctx.root's, which the call reached but didn't receive
645 const received = new Set<unknown>()
646 for (const [o, c] of call.copiedAfter) if (call.copied.has(o)) received.add(c)
647 const visited = new Set<object>()
648 for (const state of [...call.written, call.result])
649 writeOnto(state, counterparts, received, visited)
650}
651
652const replay = (
653 current: Validation,

Callers 2

isReplayableFunction · 0.85
replayFunction · 0.85

Calls 4

writeOntoFunction · 0.85
relateFunction · 0.70
hasMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected