Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

debug-proxy

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

debug-proxy - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

39

async-debug.js

@@ -1,6 +0,5 @@

/* jshint browser:true, node:true */
/* jshint browser:true, node:true, unused:true */
'use strict';
var loading = false;
var loaded = false;
var listeners = [];

@@ -10,3 +9,3 @@ var debug;

function enableDebugging() {
var loading = true;
loading = true;
require.ensure(['debug'], function(require) {

@@ -41,15 +40,8 @@ debug = require('debug');

module.exports = function debugProxy(namespace) {
function debugProxy(namespace) {
var backend;
if (debug) {
return debug(namespace);
}
listeners.push(function() {
backend = debug(namespace);
});
return function() {
var fn = function() {
if (backend) {
// Backend is loaded, just use it
backend.apply(backend, arguments);

@@ -60,6 +52,25 @@ } else if(loading) {

listeners.push(function() {
backend.apply(backend, arguments);
backend.apply(backend, args);
});
}
};
listeners.push(function() {
// Backend has been loaded, switch to it
backend = debug(namespace);
fn.enabled = backend.enabled;
});
fn.enabled = loading; // Technically this isn't totally correct as debug may filter
// this level out once the backend has started
return fn;
}
module.exports = function(namespace) {
if (debug) {
return debug(namespace);
}
return debugProxy(namespace);
};
{
"name": "debug-proxy",
"version": "0.1.1",
"version": "0.1.2",
"description": "Client side proxy for visionmedia/debug to allow delayed loading",

@@ -5,0 +5,0 @@ "main": "sync-debug.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc