Skip to content

Commit e7e0c56

Browse files
committed
Fixes #200, react-native doesn't have FileList/File
1 parent 02b8ffb commit e7e0c56

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Diff for: src/restLink.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,12 @@ const convertObjectKeys = (
612612
return object;
613613
}
614614

615-
if (object instanceof FileList || object instanceof File) {
615+
// FileList/File are only available in some browser contexts
616+
// Notably: *not available* in react-native.
617+
if (
618+
((global as any).FileList && object instanceof FileList) ||
619+
((global as any).File && object instanceof File)
620+
) {
616621
// Object is a FileList or File object => no keys to convert!
617622
return object;
618623
}

0 commit comments

Comments
 (0)