Skip to content

Commit

Permalink
update default title formatter (#186)
Browse files Browse the repository at this point in the history
  • Loading branch information
charlierudolph authored and Evgeny Rodionov committed Oct 28, 2016
1 parent f3add22 commit f54e73c
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,17 @@ function defaultTitleFormatter(options) {
timestamp, duration,
} = options;

return (action, time, took) =>
`action @ ${timestamp ? time : ``} ${action.type} ${duration ? `(in ${took.toFixed(2)} ms)` : ``}`;
return (action, time, took) => {
const parts = [`action`];
if (timestamp) {
parts.push(`@ ${time}`);
}
parts.push(action.type);
if (duration) {
parts.push(`(in ${took.toFixed(2)} ms)`);
}
return parts.join(` `);
};
}

export function printBuffer(buffer, options) {
Expand Down

0 comments on commit f54e73c

Please sign in to comment.