Skip to content

Commit f54e73c

Browse files
charlierudolphEvgeny Rodionov
authored andcommitted
update default title formatter (#186)
1 parent f3add22 commit f54e73c

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/core.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,17 @@ function defaultTitleFormatter(options) {
2727
timestamp, duration,
2828
} = options;
2929

30-
return (action, time, took) =>
31-
`action @ ${timestamp ? time : ``} ${action.type} ${duration ? `(in ${took.toFixed(2)} ms)` : ``}`;
30+
return (action, time, took) => {
31+
const parts = [`action`];
32+
if (timestamp) {
33+
parts.push(`@ ${time}`);
34+
}
35+
parts.push(action.type);
36+
if (duration) {
37+
parts.push(`(in ${took.toFixed(2)} ms)`);
38+
}
39+
return parts.join(` `);
40+
};
3241
}
3342

3443
export function printBuffer(buffer, options) {

0 commit comments

Comments
 (0)