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

Function closedProps

ark/aot/settingsValidators.ts:653–671  ·  view source on GitHub ↗
(declared, description = "removed")

Source from the content-addressed store, hash-verified

651 return checker
652}
653var closedProps = (declared, description = "removed") => {
654 const removed = siteOf("undeclared", description)
655 const walks = props(declared)
656 const checker = (data, ctx) => {
657 if (!objectCheck.test(data)) return !failsAt(ctx, objectCheck, data)
658 if (!walks(data, ctx)) return false
659 for (const k in data) {
660 if (
661 !hasOwn(declared, k) &&
662 hasOwn(data, k) &&
663 failsAtKey(ctx, removed, data, k)
664 )
665 return false
666 }
667 return true
668 }
669 checker.description = objectCheck.description
670 return checker
671}
672var recordOf = value => {
673 const checker = (data, ctx) => {
674 if (!objectCheck.test(data)) return !failsAt(ctx, objectCheck, data)

Callers 3

sitedFunction · 0.85
checkers.tsFile · 0.85

Calls 2

siteOfFunction · 0.85
propsFunction · 0.70

Tested by

no test coverage detected