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/templates/lib/plugins/renameKey.js

38 lines
842 B

4 years ago
'use strict';
var utils = require('../utils');
/**
* Add a `renameKey` function to the given `app` instance.
*/
module.exports = function(config) {
config = config || {};
return function(app) {
this.define('renameKey', function(key, file, fn) {
if (typeof key === 'function') {
return this.renameKey(null, null, key);
}
if (typeof file === 'function') {
return this.renameKey(key, null, file);
}
if (typeof fn !== 'function') {
fn = this.options.renameKey;
}
if (typeof fn !== 'function') {
fn = config.renameKey;
}
if (typeof fn !== 'function') {
fn = utils.identity;
}
this.options.renameKey = fn;
if (typeof key === 'string') {
return fn.call(this, key, file);
}
return this;
});
};
};