Skip to content

Commit

Permalink
Fixed process detection
Browse files Browse the repository at this point in the history
  • Loading branch information
RunDevelopment committed Apr 10, 2024
1 parent 0e0c639 commit 37856b2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/process.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const emptyEnv = {};

const processShim = {
get platform() {
if (typeof process !== "object") {
if (typeof process === "object") {
const pplatform = process?.platform;
if (typeof pplatform === "string") {
return pplatform;
Expand All @@ -23,7 +23,7 @@ const processShim = {
},

get env() {
if (typeof process !== "object") {
if (typeof process === "object") {
const env = process?.env;
if (typeof env === "object" && env !== null) {
return env;
Expand All @@ -34,7 +34,7 @@ const processShim = {
},

cwd() {
if (typeof process !== "object" && typeof process?.cwd === "function") {
if (typeof process === "object" && typeof process?.cwd === "function") {
return process.cwd();
}

Expand Down

0 comments on commit 37856b2

Please sign in to comment.