t×tecexpressby TeKOcloud
DEv0.7.1
API & types / VUE

TxFilter.

Comparison/text filter and nested AND, OR and NOT expressions.

The default operator is equality. Text operators ignore case. Empty AND is true; empty OR is false. Dart matches(item) returns bool; Vue txMatches(item, filter) returns boolean. Getter errors propagate.

ts
type TxFilter<T> =
  | {
      selector: TxSelector<T>
      operator?:
        | '='
        | '<>'
        | '>'
        | '>='
        | '<'
        | '<='
        | 'contains'
        | 'startswith'
        | 'endswith'
      value: unknown
    }
  | { and: TxFilter<T>[] }
  | { or: TxFilter<T>[] }
  | { not: TxFilter<T> }
ts
import type { TxFilter } from '@tekocloud.de/tecexpress'
const example: TxFilter<{ id: number }> = { selector: 'id', operator: '>=', value: 1 }
console.log(example)