From c60a2b793438e8403271532a0ced9a28561cdaaa Mon Sep 17 00:00:00 2001 From: Jorge Bucaran Date: Tue, 14 Jun 2022 12:05:54 -0300 Subject: [PATCH] Handle undefined env, argv, and platform (#94) Fix #94 --- index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 4c7bed4..0d64e6b 100644 --- a/index.js +++ b/index.js @@ -1,6 +1,10 @@ import * as tty from "tty" -const { env, argv, platform } = typeof process === "undefined" ? {} : process +const { + env = {}, + argv = [], + platform = "", +} = typeof process === "undefined" ? {} : process const isDisabled = "NO_COLOR" in env || argv.includes("--no-color") const isForced = "FORCE_COLOR" in env || argv.includes("--color")