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

Function alwaysValidSchema

lib/compile/util.ts:14–19  ·  view source on GitHub ↗
(it: SchemaCxt, schema: AnySchema)

Source from the content-addressed store, hash-verified

12}
13
14export function alwaysValidSchema(it: SchemaCxt, schema: AnySchema): boolean | void {
15 if (typeof schema == "boolean") return schema
16 if (Object.keys(schema).length === 0) return true
17 checkUnknownRules(it, schema)
18 return !schemaHasRules(schema, it.self.RULES.all)
19}
20
21export function checkUnknownRules(it: SchemaCxt, schema: AnySchema = it.schema): void {
22 const {opts, self} = it

Callers 15

schemaPropertiesFunction · 0.90
validateUnionFunction · 0.90
validateSchemaDepsFunction · 0.90
hasSchemaFunction · 0.90
codeFunction · 0.90
codeFunction · 0.90
codeFunction · 0.90
validateTupleFunction · 0.90
validateAdditionalItemsFunction · 0.90
codeFunction · 0.90
validateOneOfFunction · 0.90
codeFunction · 0.90

Calls 2

checkUnknownRulesFunction · 0.85
schemaHasRulesFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…