tools: replace loop with padStart
PR-URL: https://github.com/nodejs/node/pull/16220 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
This commit is contained in:
parent
863d1922df
commit
9d768504d2
@ -274,10 +274,7 @@ function RtfGenerator() {
|
||||
};
|
||||
|
||||
function toHex(number, length) {
|
||||
var hex = (~~number).toString(16);
|
||||
while (hex.length < length)
|
||||
hex = `0${hex}`;
|
||||
return hex;
|
||||
return (~~number).toString(16).padStart(length, '0');
|
||||
}
|
||||
|
||||
function rtfEscape(string) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user