UNPKG

@zohodesk/dot

Version:

In this Library, we Provide Some Basic Components to Build Your Application

17 lines (16 loc) 689 B
const UNASSIGNED = 'Unassigned'; const BROWSER_SUPPORTED_FILES = ['pdf', 'text', 'txt', 'css', 'jpg', 'jpeg', 'gif', 'png', 'bmp', 'ico', 'sh', 'mp3', 'wav', 'ogg']; export function isAudioFile(fileName) { const extension = getExtensionFromFileName(fileName); return /mp3|wav|ogg/i.test(extension); } export function getExtensionFromFileName(fileName) { if (fileName && fileName.indexOf(".") !== -1) { return fileName.substring(fileName.lastIndexOf(".") + 1, fileName.length).toLowerCase(); } return ""; } export function isBrowserSupportedFile(fileName) { const extension = getExtensionFromFileName(fileName); return BROWSER_SUPPORTED_FILES.indexOf(extension) !== -1; }