StackGenVis: Alignment of Data, Algorithms, and Models for Stacking Ensemble Learning Using Performance Metrics https://doi.org/10.1109/TVCG.2020.3030352
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
StackGenVis/frontend/node_modules/base-generators/lib/compose.js

50 lines
1.2 KiB

4 years ago
'use strict';
var utils = require('./utils');
/**
* Extend the generator being invoked with settings from the instance,
* but only if the generator is not the `default` generator.
*
* Also, note that this **does not add tasks** from the `default` generator
* onto the instance.
*/
module.exports = function(app, generator, ctx) {
var env = generator.env || {};
var alias = env.alias;
// update `cache.config`
var config = utils.merge({}, ctx || app.cache.config || app.pkg.get(app._name));
generator.set('cache.config', config);
// set options
utils.merge(generator.options, app.options);
utils.merge(generator.options, config);
// extend generator with settings from default
if (app.generators.hasOwnProperty('default') && alias !== 'default') {
var compose = generator
.compose(['default'])
.options();
if (typeof app.data === 'function') {
compose.data();
}
if (typeof app.pipeline === 'function') {
compose.pipeline();
}
if (typeof app.helper === 'function') {
compose.helpers();
compose.engines();
compose.views();
}
if (typeof app.question === 'function') {
compose.questions();
}
}
};