MCPcopy Index your code
hub / github.com/ember-cli/ember-cli / treeFor

Function treeFor

lib/models/addon.js:577–616  ·  view source on GitHub ↗

Returns a given type of tree (if present), merged with the application tree. For each of the trees available using this method, you can also use a direct method called `treeFor[Type]` (eg. `treeForApp`). Available tree names: - {{#crossLink "Addon/treeForApp:method"}}app{{/crossLink

(treeType)

Source from the content-addressed store, hash-verified

575 @return {Tree}
576 */
577 treeFor(treeType) {
578 let node = heimdall.start({
579 name: `treeFor(${this.name} - ${treeType})`,
580 addonName: this.name,
581 treeType,
582 treeFor: true,
583 });
584
585 let cacheKeyForTreeType = this.cacheKeyForTree(treeType);
586
587 let cachedTree = ADDON_TREE_CACHE.getItem(cacheKeyForTreeType);
588 if (cachedTree) {
589 node.stop();
590 return cachedTree;
591 }
592
593 let trees = this.eachAddonInvoke('treeFor', [treeType]);
594 let tree = this._treeFor(treeType);
595
596 if (tree) {
597 trees.push(tree);
598 }
599
600 if (this.isDevelopingAddon() && this.hintingEnabled() && treeType === 'app') {
601 trees.push(this.jshintAddonTree());
602 }
603
604 let mergedTreesForType = mergeTrees(trees, {
605 overwrite: true,
606 annotation: `Addon#treeFor (${this.name} - ${treeType})`,
607 });
608
609 if (cacheKeyForTreeType) {
610 ADDON_TREE_CACHE.setItem(cacheKeyForTreeType, mergedTreesForType);
611 }
612
613 node.stop();
614
615 return mergedTreesForType;
616 },
617
618 /**
619 @private

Callers

nothing calls this directly

Calls 1

startMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…