Skip to content

Commit 911e04c

Browse files
committed
fixup! util: add fast path to stripVTControlCharacters
1 parent bacd1a7 commit 911e04c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/internal/util/inspect.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3039,8 +3039,8 @@ function stripVTControlCharacters(str) {
30393039
// Short-circuit: all ANSI escape sequences start with either
30403040
// ESC (\u001B, 7-bit) or CSI (\u009B, 8-bit) introducer.
30413041
// If neither is present, the string has no VT control characters.
3042-
if (!StringPrototypeIncludes(str, '\u001B') &&
3043-
!StringPrototypeIncludes(str, '\u009B'))
3042+
if (StringPrototypeIndexOf(str, '\u001B') === -1 &&
3043+
StringPrototypeIndexOf(str, '\u009B') === -1)
30443044
return str;
30453045

30463046
return RegExpPrototypeSymbolReplace(ansi, str, '');

0 commit comments

Comments
 (0)