Skip to content

Commit

Permalink
fix: pad function is failing due to negative values (#295)
Browse files Browse the repository at this point in the history
fix: wrong variable name
  • Loading branch information
zacharygolba authored Aug 8, 2016
1 parent 164daec commit d11aafc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/packages/logger/request-logger/templates.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ Processed ${cyan(`${method}`)} "${path}" ${magenta('Params')} ${
* @private
*/
function countDigits(num: number) {
return Math.floor(Math.log10(num) + 1);
const digits = Math.floor(Math.log10(num) + 1);

return digits > 0 && Number.isFinite(digits) ? digits : 1;
}

/**
Expand Down

0 comments on commit d11aafc

Please sign in to comment.