booleanField
const booleanField: <Row>(input) => MemoryFieldSpec<Row>;Defined in: filters/memory.ts:158
Allow-list a public field as a boolean filter (eq/ne/null checks) over a row value
read by path.
Type Parameters
Section titled “Type Parameters”| Type Parameter | Default type |
|---|---|
Row |
any |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
input |
{ path: MemoryAccessor<Row>; } |
input.path |
MemoryAccessor<Row> |
Returns
Section titled “Returns”MemoryFieldSpec<Row>
Example
Section titled “Example”import { booleanField, buildFilterPredicate } from "@xtandard/lib/filters/memory";
const { predicate } = buildFilterPredicate({ spec: { done: booleanField({ path: "done" }) }, filters: [{ field: "done", filter: { kind: "boolean", operator: "ne", value: true } }],});predicate({ done: false }); // → truepredicate({}); // → false (a missing value is NULL)