Skip to content

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.

A

B = A

…readonly [Comparator<A, B>, Comparator<A, B>]

Comparators in priority order. At least one is required.

Comparator<A, B>

A comparator calling as few of them as the first difference allows.