Skip to content

Commit

Permalink
Optimized performance
Browse files Browse the repository at this point in the history
Signed-off-by: Jaid <[email protected]>
  • Loading branch information
Jaid committed Jan 3, 2021
1 parent 8e35e34 commit 109c9af
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const humanizer = humanizeDuration.humanizer({
* result2 === "0s"
*/
export default milliseconds => {
if (Number.isFinite(milliseconds) && milliseconds !== 0) {
if (milliseconds !== 0 && Number.isFinite(milliseconds)) {
return humanizer(milliseconds)
}
return "0s"
Expand Down

0 comments on commit 109c9af

Please sign in to comment.