lib: remove deprecated string methods

PR-URL: https://github.com/nodejs/node/pull/50592
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
Jithil P Ponnan
2023-11-12 02:44:16 +11:00
committed by GitHub
parent b8cfb35745
commit 7ad4433dbf
3 changed files with 6 additions and 6 deletions

View File

@@ -38,7 +38,7 @@ const {
StringPrototypeIndexOf,
StringPrototypeSplit,
StringPrototypeStartsWith,
StringPrototypeSubstr,
StringPrototypeSubstring,
Symbol,
} = primordials;
@@ -363,7 +363,7 @@ function calculateServerName(options, req) {
// Leading '[', but no ']'. Need to do something...
servername = hostHeader;
} else {
servername = StringPrototypeSubstr(hostHeader, 1, index - 1);
servername = StringPrototypeSubstring(hostHeader, 1, index);
}
} else {
servername = StringPrototypeSplit(hostHeader, ':', 1)[0];

View File

@@ -11,7 +11,7 @@ const {
RegExpPrototypeSymbolReplace,
StringPrototypeLocaleCompare,
StringPrototypeSlice,
StringPrototypeTrimLeft,
StringPrototypeTrimStart,
StringPrototypeRepeat,
SafeMap,
} = primordials;
@@ -180,7 +180,7 @@ function format(
else
text += StringPrototypeRepeat(' ', firstColumn - displayName.length);
text += StringPrototypeTrimLeft(
text += StringPrototypeTrimStart(
indent(fold(displayHelpText, secondColumn), firstColumn)) + '\n';
}

View File

@@ -90,7 +90,7 @@ const {
StringPrototypeSplit,
StringPrototypeStartsWith,
StringPrototypeTrim,
StringPrototypeTrimLeft,
StringPrototypeTrimStart,
StringPrototypeToLocaleLowerCase,
Symbol,
SyntaxError,
@@ -1326,7 +1326,7 @@ function complete(line, callback) {
let completeOn, group;
// Ignore right whitespace. It could change the outcome.
line = StringPrototypeTrimLeft(line);
line = StringPrototypeTrimStart(line);
let filter = '';