ember-cli/ember-cli

View on GitHub
lib/utilities/lint-addons-by-type.js

Summary

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

module.exports = function lintAddonsByType(addons, type, tree) {
  return addons.reduce((sum, addon) => {
    if (addon.lintTree) {
      let val = addon.lintTree(type, tree);
      if (val) {
        sum.push(val);
      }
    }
    return sum;
  }, []);
};