MCPcopy
hub / github.com/ajv-validator/ajv / checkMissingProp

Function checkMissingProp

lib/vocabularies/code.ts:16–26  ·  view source on GitHub ↗
(
  {gen, data, it: {opts}}: KeywordCxt,
  properties: string[],
  missing: Name
)

Source from the content-addressed store, hash-verified

14}
15
16export function checkMissingProp(
17 {gen, data, it: {opts}}: KeywordCxt,
18 properties: string[],
19 missing: Name
20): Code {
21 return or(
22 ...properties.map((prop) =>
23 and(noPropertyInData(gen, data, prop, opts.ownProperties), _`${missing} = ${prop}`)
24 )
25 )
26}
27
28export function reportMissingProp(cxt: KeywordCxt, missing: Name): void {
29 cxt.setParams({missingProperty: missing}, true)

Callers 2

validatePropertyDepsFunction · 0.90
exitOnErrorModeFunction · 0.90

Calls 4

orFunction · 0.90
andFunction · 0.90
_Function · 0.90
noPropertyInDataFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…