Skip to content

Commit 0e980d0

Browse files
stainless-ci-botRobertCraigie
authored andcommitted
fix(client): fix TypeError with undefined File
1 parent c54270a commit 0e980d0

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@
5151
"ws": "^8.18.0",
5252
"zod": "^3.23.8"
5353
},
54+
"resolutions": {
55+
"synckit": "0.8.8"
56+
},
5457
"imports": {
5558
"openai": ".",
5659
"openai/*": "./src/*"

src/internal/uploads.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,8 @@ export const createForm = async <T = Record<string, unknown>>(
128128

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

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

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3217,10 +3217,10 @@ supports-preserve-symlinks-flag@^1.0.0:
32173217
resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09"
32183218
integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==
32193219

3220-
synckit@^0.9.1:
3221-
version "0.9.2"
3222-
resolved "https://registry.yarnpkg.com/synckit/-/synckit-0.9.2.tgz#a3a935eca7922d48b9e7d6c61822ee6c3ae4ec62"
3223-
integrity sha512-vrozgXDQwYO72vHjUb/HnFbQx1exDjoKzqx23aXEg2a9VIg2TSFZ8FmeZpTjUCFMYw7mpX4BE2SFu8wI7asYsw==
3220+
synckit@0.8.8, synckit@^0.9.1:
3221+
version "0.8.8"
3222+
resolved "https://registry.yarnpkg.com/synckit/-/synckit-0.8.8.tgz#fe7fe446518e3d3d49f5e429f443cf08b6edfcd7"
3223+
integrity sha512-HwOKAP7Wc5aRGYdKH+dw0PRRpbO841v2DENBtjnR5HFWoiNByAl7vrx3p0G/rCyYXQsrxqtX48TImFtPcIHSpQ==
32243224
dependencies:
32253225
"@pkgr/core" "^0.1.0"
32263226
tslib "^2.6.2"

0 commit comments

Comments
 (0)