Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c4eb683

Browse filesBrowse files
tniessenMylesBorins
authored andcommitted
tools: use built-in padStart instead of padString
PR-URL: #17120 Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent a9be7bf commit c4eb683
Copy full SHA for c4eb683

File tree

Expand file treeCollapse file tree

1 file changed

+5
-12
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-12
lines changed
Open diff view settings
Collapse file

‎tools/lint-js.js‎

Copy file name to clipboardExpand all lines: tools/lint-js.js
+5-12Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -215,12 +215,12 @@ if (cluster.isMaster) {
215215

216216
// Calculate and format the data for displaying
217217
const elapsed = process.hrtime(startTime)[0];
218-
const mins = padString(Math.floor(elapsed / 60), 2, '0');
219-
const secs = padString(elapsed % 60, 2, '0');
220-
const passed = padString(successes, 6, ' ');
221-
const failed = padString(failures, 6, ' ');
218+
const mins = `${Math.floor(elapsed / 60)}`.padStart(2, '0');
219+
const secs = `${elapsed % 60}`.padStart(2, '0');
220+
const passed = `${successes}`.padStart(6);
221+
const failed = `${failures}`.padStart(6);
222222
var pct = Math.ceil(((totalPaths - paths.length) / totalPaths) * 100);
223-
pct = padString(pct, 3, ' ');
223+
pct = `${pct}`.padStart(3);
224224

225225
var line = `[${mins}:${secs}|%${pct}|+${passed}|-${failed}]: ${curPath}`;
226226

@@ -233,13 +233,6 @@ if (cluster.isMaster) {
233233

234234
outFn(line);
235235
}
236-
237-
function padString(str, len, chr) {
238-
str = `${str}`;
239-
if (str.length >= len)
240-
return str;
241-
return chr.repeat(len - str.length) + str;
242-
}
243236
} else {
244237
// Worker
245238

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.