diff --git a/package.json b/package.json index 21333df..12f4856 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "url": "git://github.com/groundwater/node-stackup.git" }, "dependencies": { - "async-listener": "~0.4.7" + "async-listener": "~0.4.7", + "lodash": "^3.10.1" } } diff --git a/trace.js b/trace.js index f2082af..7c85aff 100644 --- a/trace.js +++ b/trace.js @@ -1,4 +1,5 @@ var util = require('util'); +var _ = require("lodash"); function Trace(module) { this.module = module; @@ -19,7 +20,9 @@ Trace.prototype.toString = function toString(stack) { current = current.parent; } - return out.join('\n'); + return _.filter(out, function(line) { + return line.trim().length > 0; + }).join('\n'); } Trace.prototype.__format = function __format(stack) { @@ -27,7 +30,6 @@ Trace.prototype.__format = function __format(stack) { // get rid of [object Object] line split.shift(); - split.unshift(' ---- async ----'); return this.__filter(split).join('\n'); }