FieldComparators
A per-field comparison for values the client would order differently from the backend, such as numbers stored as
strings. It returns a negative number when
left
sorts before
right
, a positive one when after, and
0
when
they are equal in order.
Import
import { FieldComparators } from "@hyper-fetch/db"
Source
Package
Preview
type FieldComparators<Row> = { [ Field in keyof Row & string]?: (left: NonNullable<Row[Field]>, right: NonNullable<Row[Field]>) => number };