MCPcopy
hub / github.com/meteor/meteor / writeSymbolTree

Function writeSymbolTree

tools/isobuild/linker.js:529–546  ·  view source on GitHub ↗
(symbolTree, indent)

Source from the content-addressed store, hash-verified

527// construct a string like {Foo: s1, Bar: {Baz: s2, Quux: {A: s3, B: s4}}}
528// except with pretty indentation.
529var writeSymbolTree = function (symbolTree, indent) {
530 var put = function (node, indent) {
531 if (typeof node === "string") {
532 return node;
533 }
534 if (_.keys(node).length === 0) {
535 return '{}';
536 }
537 var spacing = new Array(indent + 1).join(' ');
538 // XXX prettyprint!
539 return "{\n" +
540 _.map(node, function (value, key) {
541 return spacing + " " + key + ": " + put(value, indent + 2);
542 }).join(',\n') + "\n" + spacing + "}";
543 };
544
545 return put(symbolTree, indent || 0);
546};
547
548
549///////////////////////////////////////////////////////////////////////////////

Callers 2

getImportCodeFunction · 0.85
getFooterFunction · 0.85

Calls 1

putFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…