Skip to content

Commit

Permalink
refactor: zeroPad to use padStart for improved readability (#182)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ayoub-Mabrouk authored Nov 11, 2024
1 parent 87c5f09 commit e2bf828
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions scripts/version-history.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,5 @@ function repeat (str, length) {
}

function zeroPad (number, length) {
var num = number.toString()

while (num.length < length) {
num = '0' + num
}

return num
return number.toString().padStart(length, '0')
}

0 comments on commit e2bf828

Please sign in to comment.