* Coerces a `$empty` operand to a boolean. Accepts a real boolean (the UI path) * and the string forms `'true'` / `'false'` (lenient raw-API input). Anything * else throws rather than silently inverting the check — a 400 with a clear * message beats returning the opposite row set.
(field: string, value: unknown)
| 543 | * message beats returning the opposite row set. |
| 544 | */ |
| 545 | function coerceEmptyFlag(field: string, value: unknown): boolean { |
| 546 | if (typeof value === 'boolean') return value |
| 547 | if (value === 'true') return true |
| 548 | if (value === 'false') return false |
| 549 | throw new TableQueryValidationError( |
| 550 | `$empty on column "${field}" requires a boolean, got ${typeof value}` |
| 551 | ) |
| 552 | } |
| 553 | |
| 554 | /** |
| 555 | * Builds an emptiness check against a JSONB cell. `isEmpty` matches null cells |
no outgoing calls
no test coverage detected