MCPcopy
hub / github.com/meteor/meteor / getImportCode

Function getImportCode

tools/isobuild/linker.js:986–1009  ·  view source on GitHub ↗
(imports, header, omitVar)

Source from the content-addressed store, hash-verified

984};
985
986function getImportCode(imports, header, omitVar) {
987 var self = this;
988
989 if (_.isEmpty(imports)) {
990 return "";
991 }
992
993 // Imports
994 var scratch = {};
995 _.each(imports, function (name, symbol) {
996 scratch[symbol] = packageDot(name) + "." + symbol;
997 });
998 var tree = buildSymbolTree(scratch);
999
1000 // Generate output
1001 var buf = header;
1002 _.each(tree, function (node, key) {
1003 buf += (omitVar ? "" : "var " ) +
1004 key + " = " + writeSymbolTree(node) + ";\n";
1005 });
1006 buf += "\n";
1007
1008 return buf;
1009}
1010
1011var getFooter = function ({
1012 name,

Callers 2

getHeaderFunction · 0.85
linker.jsFile · 0.85

Calls 5

packageDotFunction · 0.85
buildSymbolTreeFunction · 0.85
writeSymbolTreeFunction · 0.85
isEmptyMethod · 0.80
eachMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…