MCPcopy Create free account
hub / github.com/arktypeio/arktype / ruleCheckOf

Function ruleCheckOf

ark/type/standalone/combinators.ts:988–991  ·  view source on GitHub ↗
(kind: RuleKind, rule: number)

Source from the content-addressed store, hash-verified

986type RuleKind = (typeof ruleFactories)[number]
987
988const ruleCheckOf = (kind: RuleKind, rule: number): runtime.Check =>
989 kind === "divisor" && rule === 1 ?
990 runtime.integerCheck
991 : (runtime[kind] as (rule: number) => runtime.Check)(rule)
992
993const arrayLengthDescriptionOf = (kind: RuleKind, rule: number): string =>
994 kind === "maxLength" ? `at most ${rule} item${rule === 1 ? "" : "s"}`

Callers 2

writeDescribedCheckFunction · 0.85
rulesOfFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected