export const flattenOrder = ( order ) : number => { if ( typeof order === 'number' || typeof order === 'string' ) { return + order ; } if ( order === true ) { return 0 ; } return Number . NaN ; } ; export function unique < T extends any [ ] > ( data ) { return Array . from ( new Set < any > ( data ) ) as T ; }