File tree Expand file tree Collapse file tree 2 files changed +19
-2
lines changed
Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Original file line number Diff line number Diff line change 33 */
44
55exports . FormData = FormData ;
6- exports . File = File ;
76exports . Blob = Blob ;
7+ exports . File =
8+ typeof File !== 'undefined' ? File : (
9+ // Bun doesn't implement File yet, so just make a shim that throws a helpful error message
10+ class File extends Blob {
11+ constructor ( ) {
12+ throw new Error ( `file uploads aren't supported in this environment yet as 'File' is not defined` ) ;
13+ }
14+ }
15+ ) ;
816
917exports . isPolyfilled = false ;
Original file line number Diff line number Diff line change 33 */
44
55const _FormData = FormData ;
6- const _File = File ;
76const _Blob = Blob ;
87
8+ const _File =
9+ typeof File !== 'undefined' ? File : (
10+ // Bun doesn't implement File yet, so just make a shim that throws a helpful error message
11+ class File extends Blob {
12+ constructor ( ) {
13+ throw new Error ( `file uploads aren't supported in this environment yet as 'File' is not defined` ) ;
14+ }
15+ }
16+ ) ;
17+
918export { _FormData as FormData , _File as File , _Blob as Blob } ;
1019
1120export const isPolyfilled = false ;
You can’t perform that action at this time.
0 commit comments