Skip to content

Commit

Permalink
Simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
fisker committed Jan 18, 2024
1 parent e6af4c5 commit d52ab5d
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export default function prettyMilliseconds(milliseconds, options = {}) {
}

if (options.compact) {
options.unitCount = 1;
options.secondsDecimalDigits = 0;
options.millisecondsDecimalDigits = 0;
}
Expand Down Expand Up @@ -110,10 +111,6 @@ export default function prettyMilliseconds(milliseconds, options = {}) {
return '0' + (options.verbose ? ' milliseconds' : 'ms');
}

if (options.compact) {
return result[0];
}

const separator = options.colonNotation ? ':' : ' ';
if (typeof options.unitCount === 'number') {
result = result.slice(0, Math.max(options.unitCount, 1));
Expand Down

0 comments on commit d52ab5d

Please sign in to comment.