Skip to content

Commit

Permalink
Only require debug when used.
Browse files Browse the repository at this point in the history
  • Loading branch information
NE-SmallTown authored and RubenVerborgh committed Jan 25, 2021
1 parent f0e1618 commit f26e041
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions debug.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
var debug;
try {
/* eslint global-require: off */
debug = require("debug")("follow-redirects");
}
catch (error) {
debug = function () { /* */ };
}
module.exports = debug;

module.exports = function () {
if (!debug) {
try {
/* eslint global-require: off */
debug = require("debug")("follow-redirects");
}
catch (error) {
debug = function () { /* */ };
}
}
debug.apply(null, arguments);
};

0 comments on commit f26e041

Please sign in to comment.