param size returns internal export const getFileSizeMB = ( size ) : number => { return size / 1000 / 1000 ; } ; param file param types returns internal export const checkType = ( file , types ) : boolean => { const fileType = file . type . toLocaleLowerCase ( ) ; const extensionIndex = fileType . lastIndexOf ( "/" ) ; const extension = fileType . substring ( extensionIndex + 1 ) ; const loweredTypes = types . map ( type => type . toLowerCase ( ) ) ; return loweredTypes . includes ( extension ) ; } ; param types returns internal export const accepted_ext = ( types ) => { if ( types === undefined ) return "" ; return types . map ( type => `.${ type . toLowerCase ( ) }` ) . join ( "," ) ; } ;