export const readUploadedFileAsText = ( fileInput ) : Promise < string > => { const reader = new FileReader ( ) ; return new Promise ( ( resolve , reject ) => { reader . onload = ( ) => { resolve ( reader . result as string ) ; } ; try { reader . readAsText ( fileInput ) ; } catch { reader . abort ( ) ; reject ( new Error ( ) ) ; } } ) ; } ;