From c4614cd6969df56285b3f6df0a1e8e793685e2b8 Mon Sep 17 00:00:00 2001 From: Daniel Nalborczyk Date: Sat, 19 Feb 2022 20:33:50 -0500 Subject: [PATCH] refactor: use object.entries over .keys --- cli/run/timings.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/run/timings.ts b/cli/run/timings.ts index 4b4fbb400ad..ebc59b3047c 100644 --- a/cli/run/timings.ts +++ b/cli/run/timings.ts @@ -3,10 +3,10 @@ import type { SerializedTimings } from '../../src/rollup/types'; import { bold, underline } from '../../src/utils/colors'; export function printTimings(timings: SerializedTimings): void { - Object.keys(timings).forEach(label => { + Object.entries(timings).forEach(([label, [time, memory, total]]) => { const appliedColor = label[0] === '#' ? (label[1] !== '#' ? underline : bold) : (text: string) => text; - const [time, memory, total] = timings[label]; + const row = `${label}: ${time.toFixed(0)}ms, ${prettyBytes(memory)} / ${prettyBytes(total)}`; console.info(appliedColor(row)); });