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

Method tfKey

ark/schema/structure/structure.ts:713–727  ·  view source on GitHub ↗
(
			k: Key,
			value: unknown,
			node: BaseNode,
			input = value,
			pathKey: PropertyKey = k
		)

Source from the content-addressed store, hash-verified

711 const copies = !this.writesInto(ctx)
712 let out: any = data
713 const tfKey = (
714 k: Key,
715 value: unknown,
716 node: BaseNode,
717 input = value,
718 pathKey: PropertyKey = k
719 ) => {
720 let transformed = travKey(pathKey, () => transform(ctx, node, input), ctx)
721 if (input !== value)
722 transformed = mergeTransformed(input, value, transformed)
723 if (Object.is(transformed, value)) return value
724 if (out === data && copies) out = this.copy(data)
725 setOwnValue(out, k, transformed)
726 return transformed
727 }
728 const hasIndexedProp = this.hasIndexedProp
729 const props = this.inOrder
730 for (let i = 0; i < props.length; i++) {

Callers 3

jsTfMethod · 0.80
jsElemTfsMethod · 0.80
jsTfMethod · 0.80

Calls 11

copyMethod · 0.95
jsCopyMethod · 0.95
travKeyFunction · 0.90
transformFunction · 0.90
mergeTransformedFunction · 0.90
setOwnValueFunction · 0.90
jsArrayPathKeyFunction · 0.85
isMethod · 0.80
constMethod · 0.80
lineMethod · 0.80
refMethod · 0.45

Tested by

no test coverage detected