Skip to content

Commit fa220ca

Browse files
MrJithilUlisesGascon
authored andcommitted
lib: remove deprecated string methods
PR-URL: #50592 Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Paolo Insogna <paolo@cowtech.it> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 7b9b1fb commit fa220ca

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

lib/_http_agent.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const {
3838
StringPrototypeIndexOf,
3939
StringPrototypeSplit,
4040
StringPrototypeStartsWith,
41-
StringPrototypeSubstr,
41+
StringPrototypeSubstring,
4242
Symbol,
4343
} = primordials;
4444

@@ -363,7 +363,7 @@ function calculateServerName(options, req) {
363363
// Leading '[', but no ']'. Need to do something...
364364
servername = hostHeader;
365365
} else {
366-
servername = StringPrototypeSubstr(hostHeader, 1, index - 1);
366+
servername = StringPrototypeSubstring(hostHeader, 1, index);
367367
}
368368
} else {
369369
servername = StringPrototypeSplit(hostHeader, ':', 1)[0];

lib/internal/main/print_help.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const {
1111
RegExpPrototypeSymbolReplace,
1212
StringPrototypeLocaleCompare,
1313
StringPrototypeSlice,
14-
StringPrototypeTrimLeft,
14+
StringPrototypeTrimStart,
1515
StringPrototypeRepeat,
1616
SafeMap,
1717
} = primordials;
@@ -180,7 +180,7 @@ function format(
180180
else
181181
text += StringPrototypeRepeat(' ', firstColumn - displayName.length);
182182

183-
text += StringPrototypeTrimLeft(
183+
text += StringPrototypeTrimStart(
184184
indent(fold(displayHelpText, secondColumn), firstColumn)) + '\n';
185185
}
186186

lib/repl.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ const {
9090
StringPrototypeSplit,
9191
StringPrototypeStartsWith,
9292
StringPrototypeTrim,
93-
StringPrototypeTrimLeft,
93+
StringPrototypeTrimStart,
9494
StringPrototypeToLocaleLowerCase,
9595
Symbol,
9696
SyntaxError,
@@ -1326,7 +1326,7 @@ function complete(line, callback) {
13261326
let completeOn, group;
13271327

13281328
// Ignore right whitespace. It could change the outcome.
1329-
line = StringPrototypeTrimLeft(line);
1329+
line = StringPrototypeTrimStart(line);
13301330

13311331
let filter = '';
13321332

0 commit comments

Comments
 (0)