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/file-is-binary/index.js

33 lines
708 B

'use strict';
var isObject = require('isobject');
var isBinary = require('is-binary-buffer');
module.exports = function(file) {
if (!isObject(file)) {
throw new Error('expected file to be an object');
}
if (file.hasOwnProperty('_isBinary')) {
return file._isBinary;
}
if (typeof file.isStream === 'function' && file.isStream()) {
file._isBinary = false;
return false;
}
if (typeof file.isNull === 'function' && file.isNull()) {
file._isBinary = false;
return false;
}
if (typeof file.isDirectory === 'function' && file.isDirectory()) {
file._isBinary = false;
return false;
}
file._isBinary = isBinary(file.contents);
return file._isBinary;
};