Skip to content

Commit 15b44d2

Browse files
lib: improve formatting in formatHelpTextForPrint using StringPrototypePadEnd
1 parent 40256fc commit 15b44d2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/internal/util/parse_args/parse_args.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ const {
1313
ObjectPrototypeHasOwnProperty: ObjectHasOwn,
1414
StringPrototypeCharAt,
1515
StringPrototypeIndexOf,
16+
StringPrototypePadEnd,
1617
StringPrototypeSlice,
1718
StringPrototypeStartsWith,
1819
} = primordials;
@@ -332,9 +333,9 @@ function formatHelpTextForPrint(longOption, optionConfig) {
332333

333334
if (help) {
334335
if (helpTextForPrint.length > layoutSpacing) {
335-
helpTextForPrint += '\n' + ''.padEnd(layoutSpacing) + help;
336+
helpTextForPrint += `\n${StringPrototypePadEnd('', layoutSpacing)}${help}`;
336337
} else {
337-
helpTextForPrint = helpTextForPrint.padEnd(layoutSpacing) + help;
338+
helpTextForPrint = `${StringPrototypePadEnd(helpTextForPrint, layoutSpacing)}${help}`;
338339
}
339340
}
340341

0 commit comments

Comments
 (0)