1 import { MB } from '@proton/shared/lib/drive/constants';
3 export const isFile = async (item: File) => {
4 if (item.type !== '' || item.size > MB) {
8 return new Promise<void>((resolve, reject) => {
9 const reader = new FileReader();
10 reader.onload = ({ target }) => {
11 if (!target?.result) {
16 reader.onerror = reject;
17 reader.onabort = reject;
18 reader.readAsBinaryString(item);
24 export const countFilesToUpload = (
29 file?: File | undefined;
33 for (const entry of files) {
34 const file = 'path' in entry ? entry.file : entry;