ember-cli/ember-cli

View on GitHub
lib/utilities/addon-process-tree.js

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
'use strict';

module.exports = function addonProcessTree(projectOrAddon, hook, processType, tree) {
  return projectOrAddon.addons.reduce((workingTree, addon) => {
    if (addon[hook]) {
      return addon[hook](processType, workingTree);
    }

    return workingTree;
  }, tree);
};