flatten.js 254 B

12345678910
  1. module.exports = function flatten(preset) {
  2. var plugins = [].concat(preset.plugins || []);
  3. (preset.presets || []).forEach(function(child) {
  4. var children = flatten(child);
  5. if (children) plugins = plugins.concat(children);
  6. });
  7. return plugins;
  8. };