1 import saveAs from 'file-saver';
3 import { isFileSaverSupported } from './browser';
5 const downloadFile = (blob: Blob | undefined, filename: string | undefined) => {
6 if (!isFileSaverSupported()) {
7 throw new Error('Download requires a newer browser.');
10 saveAs(blob, filename);
13 export default downloadFile;