const unique = < T , Key extends keyof T > ( array , property ? ) : Array < T > => { if ( ! property ) { return Array . from ( new Set ( [ ... array ] ) ) ; } const set = new Set ( ) ; return array . filter ( ( o ) => { return ! set . has ( o [ property ] ) && set . add ( o [ property ] ) ; } ) ; } ; export default unique ;