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

Function groupKeywords

lib/compile/validate/index.ts:237–252  ·  view source on GitHub ↗
(group: RuleGroup)

Source from the content-addressed store, hash-verified

235 })
236
237 function groupKeywords(group: RuleGroup): void {
238 if (!shouldUseGroup(schema, group)) return
239 if (group.type) {
240 gen.if(checkDataType(group.type, data, opts.strictNumbers))
241 iterateKeywords(it, group)
242 if (types.length === 1 && types[0] === group.type && typeErrors) {
243 gen.else()
244 reportTypeError(it)
245 }
246 gen.endIf()
247 } else {
248 iterateKeywords(it, group)
249 }
250 // TODO make it "ok" call?
251 if (!allErrors) gen.if(_`${N.errors} === ${errsCount || 0}`)
252 }
253}
254
255function iterateKeywords(it: SchemaObjCxt, group: RuleGroup): void {

Callers 1

schemaKeywordsFunction · 0.85

Calls 8

shouldUseGroupFunction · 0.90
checkDataTypeFunction · 0.90
reportTypeErrorFunction · 0.90
_Function · 0.90
iterateKeywordsFunction · 0.85
ifMethod · 0.80
elseMethod · 0.80
endIfMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…