From 77630d99a012294b0d7135391ae548d1c3ae1252 Mon Sep 17 00:00:00 2001 From: Martin Sherburn Date: Fri, 4 Jun 2021 11:48:30 +0100 Subject: [PATCH 1/2] Don't assume process.env exists in the global scope. This causes the script to fail on platforms that don't support it. --- util.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util.js b/util.js index 6eea657..05513c5 100644 --- a/util.js +++ b/util.js @@ -106,7 +106,7 @@ exports.deprecate = function(fn, msg) { var debugs = {}; var debugEnvRegex = /^$/; -if (process.env.NODE_DEBUG) { +if (typeof process !== 'undefined' && process.env && process.env.NODE_DEBUG) { var debugEnv = process.env.NODE_DEBUG; debugEnv = debugEnv.replace(/[|\\{}()[\]^$+?.]/g, '\\$&') .replace(/\*/g, '.*') From 364a3643c37900f10e0665034333084aa622c2bd Mon Sep 17 00:00:00 2001 From: Martin Sherburn Date: Fri, 4 Jun 2021 17:08:36 +0100 Subject: [PATCH 2/2] Update util.js Co-authored-by: Jordan Harband --- util.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util.js b/util.js index 05513c5..b438a9c 100644 --- a/util.js +++ b/util.js @@ -106,7 +106,7 @@ exports.deprecate = function(fn, msg) { var debugs = {}; var debugEnvRegex = /^$/; -if (typeof process !== 'undefined' && process.env && process.env.NODE_DEBUG) { +if (typeof process !== 'undefined' && process.env.NODE_DEBUG) { var debugEnv = process.env.NODE_DEBUG; debugEnv = debugEnv.replace(/[|\\{}()[\]^$+?.]/g, '\\$&') .replace(/\*/g, '.*')