Skip to content

Commit

Permalink
refactor: use object.entries over .keys
Browse files Browse the repository at this point in the history
  • Loading branch information
dnalborczyk committed Feb 20, 2022
1 parent 45deb74 commit c4614cd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cli/run/timings.ts
Expand Up @@ -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));
});
Expand Down

0 comments on commit c4614cd

Please sign in to comment.