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

Function writeKeyOf

ark/type/standalone/keys.ts:173–179  ·  view source on GitHub ↗
(kind: string, value: Foldable, path: string)

Source from the content-addressed store, hash-verified

171 return index === -1 ? holes.push(hole) - 1 : index
172 }
173 const writeKeyOf = (kind: string, value: Foldable, path: string) => {
174 const [id, held, nested, nestedThunks] = keyOf(value)
175 values.push(`${kind} ${id} ${held.map(holeIndexOf)}`)
176 if (nested) refusal ??= [appendPath(path, nested[0]), nested[1]]
177 for (const [scope, alias, at] of nestedThunks)
178 thunks.push([scope, alias, appendPath(path, at)])
179 }
180 const at = (path: string) => (path ? ` at \`${path}\`` : "")
181 const write = (value: unknown, path: string, mode: KeyMode): void => {
182 if (hasDomain(value, "object")) {

Callers 1

writeFunction · 0.85

Calls 4

appendPathFunction · 0.85
keyOfFunction · 0.70
mapMethod · 0.65
pushMethod · 0.45

Tested by

no test coverage detected