persona-community-5/.pnpm-store/v3/files/1a/d6ea849732025fb796bc2e40609b06d4bfc1999f7b2d640aeb710cc32969f0a95a5eb7c06ab7c5a5013e1383b482c15ecd456650509134e1ff73f9b0cf9687
rdev-worker a1d0d1bf1c
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
build: /implement-feature community-ui --requirements 'Build the React commu...
2026-02-24 08:22:30 +00:00

27 lines
708 B
Plaintext

import type {
CodeKeywordDefinition,
// ErrorObject,
// KeywordErrorDefinition,
} from "../../../types"
import type {KeywordCxt} from "../../../compile/validate"
import {LimitKwd, ExclusiveLimitKwd} from "./limitNumber"
const KWDs: {[K in ExclusiveLimitKwd]: LimitKwd} = {
exclusiveMaximum: "maximum",
exclusiveMinimum: "minimum",
}
const def: CodeKeywordDefinition = {
keyword: Object.keys(KWDs),
type: "number",
schemaType: "boolean",
code({keyword, parentSchema}: KeywordCxt) {
const limitKwd = KWDs[keyword as ExclusiveLimitKwd]
if (parentSchema[limitKwd] === undefined) {
throw new Error(`${keyword} can only be used with ${limitKwd}`)
}
},
}
export default def