import base64Arraybuffer from 'base64-arraybuffer' ; export default async function ( file ) { try { if ( typeof file === 'string' ) { return base64Arraybuffer . decode ( file ) ; } if ( file && file . path ) { return file ; } if ( file instanceof ArrayBuffer ) { return file ; } throw new Error ( 'Not support for this file object' ) ; } catch ( error ) { throw error ; } }