Skip to content

Instantly share code, notes, and snippets.

@arinthros
Last active August 24, 2023 16:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arinthros/68e1b622b27b98f3a6a45585dc751b82 to your computer and use it in GitHub Desktop.
Save arinthros/68e1b622b27b98f3a6a45585dc751b82 to your computer and use it in GitHub Desktop.
Yarn Patch for Util Package
  1. Put the patch in .yarn/patches folder.
  2. Add the patch in resolutions of package.json.
  3. Make sure both files are committed to the repo.
{
"resolutions": {
"util@0.12.5": "patch:util@npm:0.12.5#.yarn/patches/util-npm-0.12.5-3668276f26.patch"
}
}
diff --git a/util.js b/util.js
index 6db393e279126c82e074539649053a2cf314206a..34ddc1adfb82d5bc6096fe9d1b9f0b25f55d5777 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.NODE_DEBUG) {
var debugEnv = process.env.NODE_DEBUG;
debugEnv = debugEnv.replace(/[|\\{}()[\]^$+?.]/g, '\\$&')
.replace(/\*/g, '.*')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment