/**
 * Checks if the argument passed is an object
 */ export const isObj = < T > ( x ) : boolean => ! ! x && typeof x === 'object' ; /**
 * Determine if two objects are equal
 */ export const equal = < T , U > ( a , b ) : boolean => Object . entries ( a ) . every ( ( [ key , val ] ) => isObj ( val ) ? equal ( b [ key ] , val ) : b [ key ] === val ) ; /**
 * Creates a function that negates the result of the predicate
 */ export const negate = < T > ( pred ) : ( ( ... args : readonly T [ ] ) => boolean ) => ( ... args ) => ! pred ( ... args ) ; /**
 * Comparer helpers
 */ export const composeComparers = < T > ( previousComparer , currentComparer ) : ( ( a : T , b : T ) => number ) => ( a , b ) => previousComparer ( a , b ) || currentComparer ( a , b ) ; export const keyComparer = < T > ( _keySelector , descending ? ) : ( ( a : T , b : T ) => number ) => ( a , b ) => { const sortKeyA = _keySelector ( a ) ; const sortKeyB = _keySelector ( b ) ; if ( sortKeyA > sortKeyB ) { return ! descending ? 1 : - 1 ; } else if ( sortKeyA < sortKeyB ) { return ! descending ? - 1 : 1 ; } else { return 0 ; } } ;