diff --git a/index.js b/index.js index c5f3d7d..d05095a 100644 --- a/index.js +++ b/index.js @@ -8,6 +8,11 @@ var smartDebug = { beautylog.log("###DEBUG:###".rainbow + ' ' + message); } }, + run: function (functionArg) { + if (debugActive) { + functionArg(); + } + }, activate: function (debugArg) { debugActive = debugArg; }, diff --git a/ts/index.ts b/ts/index.ts index eb247ce..1bf4458 100644 --- a/ts/index.ts +++ b/ts/index.ts @@ -9,6 +9,11 @@ var smartDebug = { beautylog.log("###DEBUG:###".rainbow + ' ' + message); } }, + run: function(functionArg) { + if (debugActive) { + functionArg(); + } + } activate: function(debugArg:boolean){ debugActive = debugArg; },