aboutsummaryrefslogtreecommitdiff
path: root/src/js/node/tty.js
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <jarred@jarredsumner.com> 2023-09-15 06:53:39 -0700
committerGravatar GitHub <noreply@github.com> 2023-09-15 06:53:39 -0700
commita39b0d86a046f7df28af6d4a4b6d45e062c3cd74 (patch)
tree3d243e9aec892821ad0d85cf4a8b846dffd005a7 /src/js/node/tty.js
parent6cc5872765e55650bba59cf178dd83e83535dd0b (diff)
downloadbun-a39b0d86a046f7df28af6d4a4b6d45e062c3cd74.tar.gz
bun-a39b0d86a046f7df28af6d4a4b6d45e062c3cd74.tar.zst
bun-a39b0d86a046f7df28af6d4a4b6d45e062c3cd74.zip
Fixes #5465 (#5468)
* Fixes #5465 Fixes #5465 * Update tty.js * Update InternalModuleRegistryConstants.h --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Diffstat (limited to 'src/js/node/tty.js')
-rw-r--r--src/js/node/tty.js12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/js/node/tty.js b/src/js/node/tty.js
index d5645c6da..9ccde6ffe 100644
--- a/src/js/node/tty.js
+++ b/src/js/node/tty.js
@@ -216,14 +216,12 @@ Object.defineProperty(WriteStream, "prototype", {
}
if ("TEAMCITY_VERSION" in env) {
- return RegExpPrototypeExec(/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/, env.TEAMCITY_VERSION) !== null
- ? COLORS_16
- : COLORS_2;
+ return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? COLORS_16 : COLORS_2;
}
switch (env.TERM_PROGRAM) {
case "iTerm.app":
- if (!env.TERM_PROGRAM_VERSION || RegExpPrototypeExec(/^[0-2]\./, env.TERM_PROGRAM_VERSION) !== null) {
+ if (!env.TERM_PROGRAM_VERSION || /^[0-2]\./.test(env.TERM_PROGRAM_VERSION)) {
return COLORS_256;
}
return COLORS_16m;
@@ -239,16 +237,16 @@ Object.defineProperty(WriteStream, "prototype", {
}
if (env.TERM) {
- if (RegExpPrototypeExec(/^xterm-256/, env.TERM) !== null) {
+ if (/^xterm-256/.test(env.TERM) !== null) {
return COLORS_256;
}
- const termEnv = StringPrototypeToLowerCase(env.TERM);
+ const termEnv = env.TERM.toLowerCase();
if (TERM_ENVS[termEnv]) {
return TERM_ENVS[termEnv];
}
- if (ArrayPrototypeSome(TERM_ENVS_REG_EXP, term => RegExpPrototypeExec(term, termEnv) !== null)) {
+ if (TERM_ENVS_REG_EXP.some(term => term.test(termEnv))) {
return COLORS_16;
}
}