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/middleware.js

42 lines
996 B

4 years ago
'use strict';
var debug = require('debug')('base:cli:process:middleware');
var utils = require('../utils');
/**
* Load pipeline plugins. Requires the [base-pipeline][] plugin to be
* registered.
*
* _(Modules must be locally installed and listed in `dependencies` or
* `devDependencies`)_.
*
* ```json
* {"verb": {"plugins": {"eslint": {"name": "gulp-eslint"}}}}
* ```
* @name plugins
* @api public
*/
module.exports = function(app) {
return function(obj, name, config, next) {
for (var key in obj) {
if (typeof app[key] !== 'function') {
continue;
}
if (obj.hasOwnProperty(key)) {
var arr = obj[key];
var len = arr.length;
var idx = -1;
while (++idx < len) {
var val = arr[idx];
debug('adding middleware <%s> to stage <%s>', val.name, key);
var re = utils.toRegex(val.regex || val.match || /./);
app[key](re, val.fn(val.options));
}
}
}
next();
};
};