From e2bf828a6899e18969e522ddce304fec497b058f Mon Sep 17 00:00:00 2001 From: Ayoub Mabrouk <77799760+Ayoub-Mabrouk@users.noreply.github.com> Date: Mon, 11 Nov 2024 17:29:56 +0100 Subject: [PATCH] refactor: zeroPad to use padStart for improved readability (#182) --- scripts/version-history.js | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/scripts/version-history.js b/scripts/version-history.js index b8a2b0e..0baecb7 100644 --- a/scripts/version-history.js +++ b/scripts/version-history.js @@ -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') }