Skip to main content

Type Alias: LexicographicComparison

LexicographicComparison: -1 | 0 | 1

Represents the result of a lexicographic comparison.

The operations are as follows:

  • Two iterators are compared element by element.
  • The first pair of unequal elements determines the result.
  • If one sequence is a prefix of the other, the shorter sequence is lexicographically less than the other.
  • If two sequences have the same elements in the same order, they are lexicographically equal.
  • An empty sequence is lexicographically less than any non-empty sequence.
  • Two empty sequences are lexicographically equal.

Defined in

projects/utilities/packages/iterator-utilities/src/lib/shared/_compare.ts:13