Files
est-frame/node_modules/ajv/lib/vocabularies/applicator/thenElse.ts
2025-10-22 05:38:27 +00:00

14 lines
441 B
TypeScript
Executable File

import type {CodeKeywordDefinition} from "../../types"
import type {KeywordCxt} from "../../compile/validate"
import {checkStrictMode} from "../../compile/util"
const def: CodeKeywordDefinition = {
keyword: ["then", "else"],
schemaType: ["object", "boolean"],
code({keyword, parentSchema, it}: KeywordCxt) {
if (parentSchema.if === undefined) checkStrictMode(it, `"${keyword}" without "if" is ignored`)
},
}
export default def