import numeral from '@elastic/numeral' ; param metrics param fixture returns export function normalizeDataTypeDifferences ( metrics , fixture ) { return Object . keys ( metrics ) . reduce ( ( accum , metricName ) => { accum [ metricName ] = metrics [ metricName ] . map ( ( item , index ) => { return { ... item , data : item . data . map ( ( [ _x , y ] , index2 ) => { const expectedY = fixture . metrics [ metricName ] [ index ] . data [ index2 ] [ 1 ] ; if ( y !== expectedY ) { const normalizedY = numeral ( y ) . format ( '0[.]00000' ) ; const normalizedExpectedY = numeral ( y ) . format ( '0[.]00000' ) ; if ( normalizedY === normalizedExpectedY ) { return [ _x , expectedY ] ; } } return [ _x , y ] ; } ) , } ; } ) ; return accum ; } , { } ) ; }