From 9d07bef892f0efc95b10088a0168008115b0973a Mon Sep 17 00:00:00 2001 From: Salem Mohammed Shamakh <58360393+salemkode@users.noreply.github.com> Date: Mon, 27 Dec 2021 19:41:25 +0300 Subject: [PATCH 1/2] Fix #43 --- util.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/util.js b/util.js index 6eea657..a91492e 100644 --- a/util.js +++ b/util.js @@ -105,9 +105,8 @@ exports.deprecate = function(fn, msg) { var debugs = {}; var debugEnvRegex = /^$/; - -if (process.env.NODE_DEBUG) { - var debugEnv = process.env.NODE_DEBUG; +if (process && process.env && process.env.NODE_DEBUG) { + var debugEnv = env.NODE_DEBUG; debugEnv = debugEnv.replace(/[|\\{}()[\]^$+?.]/g, '\\$&') .replace(/\*/g, '.*') .replace(/,/g, '$|^') From 623b5a47234085394da6e6181742bb86e68d8215 Mon Sep 17 00:00:00 2001 From: Salem Mohammed Shamakh <58360393+salemkode@users.noreply.github.com> Date: Tue, 28 Dec 2021 06:24:29 +0300 Subject: [PATCH 2/2] Update util.js --- util.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util.js b/util.js index a91492e..2bba625 100644 --- a/util.js +++ b/util.js @@ -105,7 +105,7 @@ exports.deprecate = function(fn, msg) { var debugs = {}; var debugEnvRegex = /^$/; -if (process && process.env && process.env.NODE_DEBUG) { +if (typeof process !== 'undefined' && process.env && process.env.NODE_DEBUG) { var debugEnv = env.NODE_DEBUG; debugEnv = debugEnv.replace(/[|\\{}()[\]^$+?.]/g, '\\$&') .replace(/\*/g, '.*')