ComparatorHandlers
Defined in: comparators.ts:41
How to order (and optionally coerce) values of a custom comparable type.
Properties
Section titled “Properties”| Property | Type | Description | Defined in |
|---|---|---|---|
compare |
(a, b) => number |
Order two values of the matched type: negative if a < b, 0 if equal, positive if a > b. May throw — a throw is treated as “not comparable” and fails the condition closed. |
comparators.ts:47 |
parser? |
(raw) => unknown |
Optional: lift the other operand (the one the predicate did not match, typically the JSON-stored condition value) into the comparable type before ComparatorHandlers.compare. May throw; on failure the original operand is passed through unchanged. | comparators.ts:54 |