Urara-Blog/node_modules/.pnpm-store/v3/files/2e/493b2066069a0a24f70fb675639b49ea8ff9ee2c2de95e93b5692926567ef226b6a4b77c4888d9f873b0608c545e6381023e6e5934b9a76b8c05f29675e2bd
2022-08-14 01:14:53 +08:00

13 lines
441 B
Text

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