mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
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:
@@ -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];
|
||||
|
||||
@@ -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';
|
||||
}
|
||||
|
||||
|
||||
@@ -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 = '';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user