Skip to content

Commit 249d5d5

Browse files
committed
chore: Add string type check
1 parent db133ad commit 249d5d5

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/AjaxUploader.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,12 @@ class AjaxUploader extends Component<UploadProps> {
141141
}
142142

143143
const parsedFile =
144-
typeof transformedFile === 'object' && transformedFile ? transformedFile : file;
144+
// string type is from legacy `transformFile`.
145+
// Not sure if this will work since no related test case works with it
146+
(typeof transformedFile === 'object' || typeof transformedFile === 'string') &&
147+
transformedFile
148+
? transformedFile
149+
: file;
145150

146151
// Used for `request.ts` get form data name
147152
if (!(parsedFile as any).name) {

0 commit comments

Comments
 (0)