createChainedComparator
createChainedComparator<
A,B>(…compares):Comparator<A,B>
Defined in: packages/core/src/function/compare/create-chained-comparator.ts:12
Chains comparators, each breaking the ties left by the one before it.
Variadic rather than a traits object because the comparators are
homogeneous and their order is the priority; named fields would lose it.
Type Parameters
Section titled “Type Parameters”A
B = A
Parameters
Section titled “Parameters”compares
Section titled “compares”…readonly [Comparator<A, B>, Comparator<A, B>]
Comparators in priority order. At least one is required.
Returns
Section titled “Returns”Comparator<A, B>
A comparator calling as few of them as the first difference allows.