Skip to content

Commit

Permalink
fix(client): fix TypeError with undefined File (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] committed Mar 4, 2025
1 parent c5d034a commit 2bc2cb6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/internal/uploads.ts
Original file line number Diff line number Diff line change
@@ -128,7 +128,8 @@ export const createForm = async <T = Record<string, unknown>>(

// We check for Blob not File because Bun.File doesn't inherit from File,
// but they both inherit from Blob and have a `name` property at runtime.
const isNamedBlob = (value: object) => value instanceof File || (value instanceof Blob && 'name' in value);
const isNamedBlob = (value: object) =>
(File && value instanceof File) || (value instanceof Blob && 'name' in value);

const isUploadable = (value: unknown) =>
typeof value === 'object' &&

0 comments on commit 2bc2cb6

Please sign in to comment.