1 import type {CodeKeywordDefinition, ErrorNoParams, AnySchema} from "../../types"
2 import type {KeywordCxt} from "../../compile/validate"
3 import {alwaysValidSchema} from "../../compile/util"
5 export type NotKeywordError = ErrorNoParams<"not", AnySchema>
7 const def: CodeKeywordDefinition = {
9 schemaType: ["object", "boolean"],
11 code(cxt: KeywordCxt) {
12 const {gen, schema, it} = cxt
13 if (alwaysValidSchema(it, schema)) {
18 const valid = gen.name("valid")
35 error: {message: "must NOT be valid"},