packageDocumentation module see SortedArray see Dictionary see IndexMap see PriorityQueue public export type OrderedComparator < T , U = T > = ( lhs : T , rhs : U ) => number ; public export function compareWithTolerance ( a , b , tolerance = 0.1 ) { if ( a < b - tolerance ) return - 1 ; else if ( a > b + tolerance ) return 1 ; else return 0 ; } public export function compareNumbers ( a , b ) { return a - b ; } public export function compareBooleans ( a , b ) { return a !== b ? ( a < b ? - 1 : 1 ) : 0 ; } public export function compareStrings ( a , b ) { return a === b ? 0 : ( a < b ? - 1 : 1 ) ; } public export function comparePossiblyUndefined < T > ( compareDefined , lhs ? , rhs ? ) { if ( undefined === lhs ) return undefined === rhs ? 0 : - 1 ; else if ( undefined === rhs ) return 1 ; else return compareDefined ( lhs , rhs ) ; } public export function compareStringsOrUndefined ( lhs ? , rhs ? ) { return comparePossiblyUndefined ( compareStrings , lhs , rhs ) ; } public export function compareNumbersOrUndefined ( lhs ? , rhs ? ) { return comparePossiblyUndefined ( compareNumbers , lhs , rhs ) ; } public export function compareBooleansOrUndefined ( lhs ? , rhs ? ) { return comparePossiblyUndefined ( compareBooleans , lhs , rhs ) ; } public export function areEqualPossiblyUndefined < T , U > ( t , u , areEqual ) { if ( undefined === t ) return undefined === u ; else if ( undefined === u ) return false ; else return areEqual ( t , u ) ; }