PNG  IHDR;IDATxܻn0K )(pA 7LeG{ §㻢|ذaÆ 6lذaÆ 6lذaÆ 6lom$^yذag5bÆ 6lذaÆ 6lذa{ 6lذaÆ `}HFkm,mӪôô! x|'ܢ˟;E:9&ᶒ}{v]n&6 h_tڠ͵-ҫZ;Z$.Pkž)!o>}leQfJTu іچ\X=8Rن4`Vwl>nG^is"ms$ui?wbs[m6K4O.4%/bC%t Mז -lG6mrz2s%9s@-k9=)kB5\+͂Zsٲ Rn~GRC wIcIn7jJhۛNCS|j08yiHKֶۛkɈ+;SzL/F*\Ԕ#"5m2[S=gnaPeғL lذaÆ 6l^ḵaÆ 6lذaÆ 6lذa; _ذaÆ 6lذaÆ 6lذaÆ RIENDB` // treeify.js // Luke Plaster // https://github.com/notatestuser/treeify.js // do the universal module definition dance (function (root, factory) { if (typeof exports === 'object') { module.exports = factory(); } else if (typeof define === 'function' && define.amd) { define(factory); } else { root.treeify = factory(); } }(this, function() { function makePrefix(key, last) { var str = (last ? '└' : '├'); if (key) { str += '─ '; } else { str += '──┐'; } return str; } function filterKeys(obj, hideFunctions) { var keys = []; for (var branch in obj) { // always exclude anything in the object's prototype if (!obj.hasOwnProperty(branch)) { continue; } // ... and hide any keys mapped to functions if we've been told to if (hideFunctions && ((typeof obj[branch])==="function")) { continue; } keys.push(branch); } return keys; } function growBranch(key, root, last, lastStates, showValues, hideFunctions, callback) { var line = '', index = 0, lastKey, circular, lastStatesCopy = lastStates.slice(0); if (lastStatesCopy.push([ root, last ]) && lastStates.length > 0) { // based on the "was last element" states of whatever we're nested within, // we need to append either blankness or a branch to our line lastStates.forEach(function(lastState, idx) { if (idx > 0) { line += (lastState[1] ? ' ' : '│') + ' '; } if ( ! circular && lastState[0] === root) { circular = true; } }); // the prefix varies based on whether the key contains something to show and // whether we're dealing with the last element in this collection line += makePrefix(key, last) + key; // append values and the circular reference indicator showValues && (typeof root !== 'object' || root instanceof Date) && (line += ': ' + root); circular && (line += ' (circular ref.)'); callback(line); } // can we descend into the next item? if ( ! circular && typeof root === 'object') { var keys = filterKeys(root, hideFunctions); keys.forEach(function(branch){ // the last key is always printed with a different prefix, so we'll need to know if we have it lastKey = ++index === keys.length; // hold your breath for recursive action growBranch(branch, root[branch], lastKey, lastStatesCopy, showValues, hideFunctions, callback); }); } }; // -------------------- var Treeify = {}; // Treeify.asLines // -------------------- // Outputs the tree line-by-line, calling the lineCallback when each one is available. Treeify.asLines = function(obj, showValues, hideFunctions, lineCallback) { /* hideFunctions and lineCallback are curried, which means we don't break apps using the older form */ var hideFunctionsArg = typeof hideFunctions !== 'function' ? hideFunctions : false; growBranch('.', obj, false, [], showValues, hideFunctionsArg, lineCallback || hideFunctions); }; // Treeify.asTree // -------------------- // Outputs the entire tree, returning it as a string with line breaks. Treeify.asTree = function(obj, showValues, hideFunctions) { var tree = ''; growBranch('.', obj, false, [], showValues, hideFunctions, function(line) { tree += line + '\n'; }); return tree; }; // -------------------- return Treeify; }));