File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -121,6 +121,10 @@ function flatten<T>(items: any[]): T[] {
121121}
122122
123123function fromDataTransferItem ( item : DataTransferItem ) {
124+ if ( 'getAsFileSystemHandle' in DataTransferItem . prototype ) {
125+ return item . getAsFileSystemHandle ( ) . then ( ( fileSystemHandle : any ) => fileSystemHandle . getFile ( ) )
126+ . catch ( ( error : { message : any ; } ) => error . message ) ;
127+ }
124128 const file = item . getAsFile ( ) ;
125129 if ( ! file ) {
126130 return Promise . reject ( `${ item } is not a File` ) ;
@@ -185,4 +189,4 @@ async function fromFileEntry(entry: any) {
185189// https://github.com/Microsoft/TypeScript/issues/3496#issuecomment-128553540
186190interface FileArray extends Array < FileValue > { }
187191type FileValue = FileWithPath
188- | FileArray [ ] ;
192+ | FileArray [ ] ;
You can’t perform that action at this time.
0 commit comments