We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4129df4 commit 170fdf8Copy full SHA for 170fdf8
src/internal/utils/strings/pad-left-zeros.ts
@@ -5,8 +5,5 @@
5
* Prefixes given text with zeros until it reaches the target length.
6
*/
7
export function padLeftZeros(text: string, length: number): string {
8
- while (text.length < length) {
9
- text = `0${text}`;
10
- }
11
- return text;
+ return text.padStart(length, '0');
12
}
0 commit comments