Type Alias: AttributePredicate
AttributePredicate = {
attribute:string;operator:"eq"|"ne";value:JsonScalar; } | {attribute:string;operator:"in"|"nin";value:JsonScalar[]; } | {attribute:string;operator:"gt"|"gte"|"lt"|"lte";value:number; }
Defined in: packages/polizy/src/types.ts:58
An attribute-based predicate evaluated against the context passed to
check(). attribute is a dot-path into the context object.
Union Members
Type Literal
{ attribute: string; operator: "eq" | "ne"; value: JsonScalar; }
attribute
attribute:
string
Matches when the context attribute equals the given value.
operator
operator:
"eq"|"ne"
value
value:
JsonScalar
Type Literal
{ attribute: string; operator: "in" | "nin"; value: JsonScalar[]; }
attribute
attribute:
string
Matches when the context attribute is in or not in the given array of values.
operator
operator:
"in"|"nin"
value
value:
JsonScalar[]
Type Literal
{ attribute: string; operator: "gt" | "gte" | "lt" | "lte"; value: number; }
attribute
attribute:
string
Matches when the context attribute is compared numerically to the given number.
operator
operator:
"gt"|"gte"|"lt"|"lte"
value
value:
number