paraview-glance
Version:
Web application for Visualizing Scientific and Medical datasets
14 lines (10 loc) • 350 B
JavaScript
;
const getFileExtension = filePath => {
let extension = filePath.slice((filePath.lastIndexOf('.') - 1 >>> 0) + 2);
if (extension.toLowerCase() === 'gz') {
const index = filePath.slice(0, -3).lastIndexOf('.');
extension = filePath.slice((index - 1 >>> 0) + 2);
}
return extension;
};
module.exports = getFileExtension;