Skip to content

Commit

Permalink
Handle undefined env, argv, and platform (#94)
Browse files Browse the repository at this point in the history
Fix #94
  • Loading branch information
jorgebucaran committed Jun 14, 2022
1 parent 668a978 commit c60a2b7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion 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")
Expand Down

0 comments on commit c60a2b7

Please sign in to comment.