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

Method copy

ark/schema/structure/structure.ts:970–978  ·  view source on GitHub ↗
(data: object, copy = copyOf(data))

Source from the content-addressed store, hash-verified

968 }
969
970 private copy(data: object, copy = copyOf(data)): object {
971 if (this.sequence) {
972 for (const prop of this.inOrder) {
973 if (hasOwn(data, prop.key))
974 setOwnValue(copy, prop.key, data[prop.key as never])
975 }
976 }
977 return copy
978 }
979
980 /** its props whose key `Object.prototype` has, which data can inherit */
981 readonly protoProps: Prop.Node[] = this.props.filter(

Callers 5

tfKeyMethod · 0.95
tTransformMethod · 0.95
applyStructMorphMethod · 0.95
updateMethod · 0.80

Calls 7

jsCopyPropsMethod · 0.95
jsShapeCheckMethod · 0.95
copyOfFunction · 0.90
hasOwnFunction · 0.90
setOwnValueFunction · 0.90
setMethod · 0.45
refMethod · 0.45

Tested by 1