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.
31 lines
662 B
31 lines
662 B
4 years ago
|
/*!
|
||
|
* stringify-author <https://github.com/jonschlinkert/stringify-author>
|
||
|
*
|
||
|
* Copyright (c) 2014-2015 Jon Schlinkert.
|
||
|
* Licensed under the MIT license.
|
||
|
*/
|
||
|
|
||
|
'use strict';
|
||
|
|
||
|
module.exports = function (author) {
|
||
|
if (typeof author !== 'object') {
|
||
|
throw new Error('expected an author to be an object');
|
||
|
}
|
||
|
|
||
|
var tmpl = {name: ['', ''], email: ['<', '>'], url: ['(', ')']};
|
||
|
var str = '';
|
||
|
|
||
|
if (author.url) author.url = stripSlash(author.url);
|
||
|
|
||
|
for (var key in tmpl) {
|
||
|
if (author[key]) {
|
||
|
str += tmpl[key][0] + author[key] + tmpl[key][1] + ' ';
|
||
|
}
|
||
|
}
|
||
|
return str.trim();
|
||
|
};
|
||
|
|
||
|
function stripSlash(str) {
|
||
|
return str.replace(/\/$/, '');
|
||
|
}
|