From 304f3801bd18523a2ca344b3644100b6f87c1307 Mon Sep 17 00:00:00 2001 From: Philipp Kunz Date: Sat, 28 Nov 2015 22:43:57 +0100 Subject: [PATCH] add smartdebug.run() function --- index.js | 5 +++++ ts/index.ts | 5 +++++ 2 files changed, 10 insertions(+) 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; },