Skip to content

Commit e2bf828

Browse files
refactor: zeroPad to use padStart for improved readability (#182)
1 parent 87c5f09 commit e2bf828

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

scripts/version-history.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,5 @@ function repeat (str, length) {
5353
}
5454

5555
function zeroPad (number, length) {
56-
var num = number.toString()
57-
58-
while (num.length < length) {
59-
num = '0' + num
60-
}
61-
62-
return num
56+
return number.toString().padStart(length, '0')
6357
}

0 commit comments

Comments
 (0)