diff --git a/lib/index.js b/lib/index.js index a435e59..f1411b3 100644 --- a/lib/index.js +++ b/lib/index.js @@ -99,14 +99,15 @@ Tree.prototype.set = function(key, value) { node.value = value; return this; }; +var _treeToString = function() { return '[object Tree]'; }; +if(process && process.env && process.env.NODE_ENV === 'development'){ + _treeToString = require('./toString') ; +} -var _treeToString = process.env.NODE_ENV === 'development' ? - require('./toString') : - function() { return '[object Tree]'; }; /** * For debuggability - * + * * @returns {String} */ Tree.prototype.toString = function() {