type callbackFn < V > = ( value : V , index : number , array : Array < V > ) => V ; function unique < T > ( arr , f ? ) { let vArr = arr ; if ( f ) { vArr = arr . map ( f ) ; } return arr . filter ( ( _ , i ) => vArr . indexOf ( vArr [ i ] ) === i ) ; } function equals < T > ( arr1 , arr2 ) { if ( arr1 === null || arr2 === null ) { return false ; } if ( arr1 . length !== arr2 . length ) { return false ; } for ( const i in arr1 ) { if ( arr1 [ i ] !== arr2 [ i ] ) { return false ; } } return true ; } export { unique , equals } ;