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

Method keepDeclared

ark/schema/structure/structure.ts:926–932  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

924 }
925 // an object's copy drops a declared key data holds as a non-enumerable own prop
926 const keepDeclared = () => {
927 if (sequence) return
928 for (const prop of this.inOrder) {
929 if (!hasOwn(out, prop.key) && hasOwn(data, prop.key))
930 setOwnValue(out, prop.key, data[prop.key as never])
931 }
932 }
933 if (out !== data) keepDeclared()
934 if (this.undeclared !== "delete" || sliced) return out
935 // a result is built of own values, so data's own "__proto__" is copied

Callers

nothing calls this directly

Calls 2

hasOwnFunction · 0.90
setOwnValueFunction · 0.90

Tested by

no test coverage detected