Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function getTypeByExtention(path) {
let type = 'none';
let ext = path.slice((path.lastIndexOf(".") + 1));
if (textExtensions.includes(ext)) {
type = 'text';
} else if (imageExt.includes(ext)) {
type = 'image';
} else if (videoExtensions.includes(ext)) {
type = 'video';
}
return type;
}