diff --git a/bin/log-perormance-results.js b/bin/log-perormance-results.js index a7d5616ce2e98..568760d49bce4 100755 --- a/bin/log-perormance-results.js +++ b/bin/log-perormance-results.js @@ -38,13 +38,10 @@ const data = new TextEncoder().encode( metrics: resultsFiles.reduce( ( result, { metricsPrefix }, index ) => { return { ...result, - ...Object.keys( performanceResults[ index ][ hash ] ).reduce( - ( accumulator, key ) => { - accumulator[ metricsPrefix + key ] = - performanceResults[ index ][ hash ][ key ]; - return accumulator; - }, - {} + ...Object.fromEntries( + Object.entries( performanceResults[ index ][ hash ] ).map( + ( [ key, value ] ) => [ metricsPrefix + key, value ] + ) ), }; } ), @@ -52,13 +49,14 @@ const data = new TextEncoder().encode( ( result, { metricsPrefix }, index ) => { return { ...result, - ...Object.keys( - performanceResults[ index ][ baseHash ] - ).reduce( ( accumulator, key ) => { - accumulator[ metricsPrefix + key ] = - performanceResults[ index ][ hash ][ key ]; - return accumulator; - }, {} ), + ...Object.fromEntries( + Object.entries( + performanceResults[ index ][ baseHash ] + ).map( ( [ key, value ] ) => [ + metricsPrefix + key, + value, + ] ) + ), }; }, {}