Comparer Namespace
Package: @esfx/equatable
Provides various implementations of Comparer
.
Functions
create(comparison)
Creates a Comparer
from a comparison function.
Declaration
function create<T>(comparison: Comparison<T>): Comparer<T>;
Type Parameters
- T
The type of value that can be compared.
Parameters
Returns
Comparer<T>
The Comparer for the provided comparison function.
hasInstance(value)
Declaration
function hasInstance(value: unknown): value is Comparer<unknown>;
Parameters
- value
- unknown
Returns
value is Comparer<unknown>
Variables
defaultComparer
The default Comparer
.
Declaration
defaultComparer: Comparer<unknown>
structuralComparer
A default Comparer
that supports StructuralComparable
values.
Declaration
structuralComparer: Comparer<unknown>
tupleComparer
A default Comparer
that compares array values rather than the arrays themselves.
Declaration
tupleComparer: Comparer<readonly unknown[]>
tupleStructuralComparer
A default Comparer
that compares array values that may be StructuralComparable
rather than the arrays themselves.
Declaration
tupleStructuralComparer: Comparer<readonly unknown[]>