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 authored and GitHub committed 2023-11-11 15:44:16 +00:00
1 parent b8cfb35745
commit 7ad4433dbf
3 files changed
+6 -6

No files matched your search

+2 -2
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];
+2 -2
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';
}
+2 -2
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 = '';