@total-order/lex
v1.0.0
Published
Lexicographical comparison functions for JavaScript
Downloads
219
Readme
:dango: @total-order/lex
Lexicographical comparison functions for JavaScript. See docs.
import { reversed } from '@total-order/reversed' ;
import { lexicographical } from '@total-order/lex' ;
import { increasing } from '@total-order/primitive' ;
let order = reversed( lexicographical( increasing ) ) ;
order( [ 1 , 1 ] , [ 1 , 2 ] ) > 0 ; // true
:scroll: References
- https://en.wikipedia.org/wiki/Lexicographical_order