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-config-process/lib/fields/generators.js

52 lines
1.2 KiB

'use strict';
var debug = require('debug')('base:cli:process');
/**
* _(Requires [templates][], otherwise ignored)_
*
* Register generators to use in templates. Value can be a string or
* array of module names, glob patterns, or file paths, or an object
* where each key is a filepath, glob or module name, and the value
* is an options object to pass to resolved generators.
*
* _(Modules must be locally installed and listed in `dependencies` or
* `devDependencies`)_.
*
* ```json
* // module names
* {
* "verb": {
* "generators": {
* "generator-foo": {},
* "generator-bar": {}
* }
* }
* }
*
* // register a glob of generators
* {
* "verb": {
* "generators": ["foo/*.js"]
* }
* }
* ```
* @name generators
* @api public
*/
module.exports = function(app, base, env, options) {
return function(generators, key, config, next) {
if (typeof app.generator !== 'function') {
next(new Error('expected app.generator to be a function'));
return;
}
for (var prop in generators) {
debug('loading generator "%s"', prop);
this.register(prop, generators[prop].fn);
}
next();
};
};