diff options
Diffstat (limited to 'deps/npm/node_modules/npm-profile/node_modules/make-fetch-happen/node_modules/https-proxy-agent/node_modules/debug/src/debug.js')
-rw-r--r-- | deps/npm/node_modules/npm-profile/node_modules/make-fetch-happen/node_modules/https-proxy-agent/node_modules/debug/src/debug.js | 37 |
1 files changed, 7 insertions, 30 deletions
diff --git a/deps/npm/node_modules/npm-profile/node_modules/make-fetch-happen/node_modules/https-proxy-agent/node_modules/debug/src/debug.js b/deps/npm/node_modules/npm-profile/node_modules/make-fetch-happen/node_modules/https-proxy-agent/node_modules/debug/src/debug.js index 77e6384a33..6a5e3fc94c 100644 --- a/deps/npm/node_modules/npm-profile/node_modules/make-fetch-happen/node_modules/https-proxy-agent/node_modules/debug/src/debug.js +++ b/deps/npm/node_modules/npm-profile/node_modules/make-fetch-happen/node_modules/https-proxy-agent/node_modules/debug/src/debug.js @@ -14,11 +14,6 @@ exports.enabled = enabled; exports.humanize = require('ms'); /** - * Active `debug` instances. - */ -exports.instances = []; - -/** * The currently active debug mode names, and names to skip. */ @@ -34,6 +29,12 @@ exports.skips = []; exports.formatters = {}; /** + * Previous log timestamp. + */ + +var prevTime; + +/** * Select a color. * @param {String} namespace * @return {Number} @@ -61,8 +62,6 @@ function selectColor(namespace) { function createDebug(namespace) { - var prevTime; - function debug() { // disabled? if (!debug.enabled) return; @@ -119,28 +118,15 @@ function createDebug(namespace) { debug.enabled = exports.enabled(namespace); debug.useColors = exports.useColors(); debug.color = selectColor(namespace); - debug.destroy = destroy; // env-specific initialization logic for debug instances if ('function' === typeof exports.init) { exports.init(debug); } - exports.instances.push(debug); - return debug; } -function destroy () { - var index = exports.instances.indexOf(this); - if (index !== -1) { - exports.instances.splice(index, 1); - return true; - } else { - return false; - } -} - /** * Enables a debug mode by namespaces. This can include modes * separated by a colon and wildcards. @@ -155,11 +141,10 @@ function enable(namespaces) { exports.names = []; exports.skips = []; - var i; var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); var len = split.length; - for (i = 0; i < len; i++) { + for (var i = 0; i < len; i++) { if (!split[i]) continue; // ignore empty strings namespaces = split[i].replace(/\*/g, '.*?'); if (namespaces[0] === '-') { @@ -168,11 +153,6 @@ function enable(namespaces) { exports.names.push(new RegExp('^' + namespaces + '$')); } } - - for (i = 0; i < exports.instances.length; i++) { - var instance = exports.instances[i]; - instance.enabled = exports.enabled(instance.namespace); - } } /** @@ -194,9 +174,6 @@ function disable() { */ function enabled(name) { - if (name[name.length - 1] === '*') { - return true; - } var i, len; for (i = 0, len = exports.skips.length; i < len; i++) { if (exports.skips[i].test(name)) { |