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.
35 lines
805 B
35 lines
805 B
/*!
|
|
* get-view <https://github.com/jonschlinkert/get-view>
|
|
*
|
|
* Copyright (c) 2016-2017, Jon Schlinkert.
|
|
* Released under the MIT License.
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var isObject = require('isobject');
|
|
var isMatch = require('match-file');
|
|
var path = require('path');
|
|
|
|
module.exports = function getFile(name, collection, fn) {
|
|
var file = collection[name];
|
|
if (file) return file;
|
|
|
|
if (typeof fn === 'function') {
|
|
file = collection[fn(name)];
|
|
if (file) return file;
|
|
}
|
|
|
|
for (var key in collection) {
|
|
file = collection[key];
|
|
if (!isObject(file)) {
|
|
throw new TypeError('expected file to be an object');
|
|
}
|
|
if (typeof file.path !== 'string') {
|
|
throw new TypeError('expected file.path to be a string');
|
|
}
|
|
if (isMatch(name, file)) {
|
|
return file;
|
|
}
|
|
}
|
|
};
|
|
|