mirror of
https://github.com/Sevichecc/Urara-Blog.git
synced 2025-05-02 13:39:30 +08:00
13 lines
441 B
Text
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
|