UNPKG

verdict-rules

Version:

A small, zero-dependency, async-native rule-evaluation engine. Compose conditions into one explainable pass/fail verdict, with sequential evaluation and real short-circuiting as a guarantee.

21 lines (20 loc) • 583 B
/** * Thrown when a lookup names a rule or group that does not exist. * * ```ts * try { * await engine.runGroup("cor", ctx); * } catch (err) { * if (err instanceof UnknownLookupError && err.kind === "group") { * // a typo, not a failed evaluation * } * } * ``` */ export declare class UnknownLookupError extends Error { /** Whether the missing thing was a rule name or a group label. */ readonly kind: "rule" | "group"; /** The name or label that matched nothing. */ readonly key: string; constructor(kind: "rule" | "group", key: string); }