Skip to content

Commit 0abf094

Browse files
committed
fix: Check if FileList class exists before accessing it
1 parent bcea477 commit 0abf094

5 files changed

Lines changed: 1 addition & 11 deletions

File tree

src/__tests__/app.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { expectTypeOf } from "expect-type";
66
import type { AnyDef, GetAppData } from "../types";
77
import { zodSchemaAdapter } from "../adapters/zod-schema-adapter";
88
import { HttpStatus } from "../status";
9-
import "./file-list-polyfill";
109

1110
// Silence console.error logs
1211
globalThis.console.error = mock();

src/__tests__/client.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import { expectTypeOf } from "expect-type";
77
import { z } from "zod/v4";
88
import { HttpStatus } from "../status";
99
import { ErrorResponse, NoResponse } from "../schema";
10-
import "./file-list-polyfill";
1110

1211
// Silence console.error logs
1312
globalThis.console.error = mock();

src/__tests__/file-list-polyfill.ts

Lines changed: 0 additions & 7 deletions
This file was deleted.

src/__tests__/types.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { z } from "zod/v4";
55
import type { StandardSchemaV1 } from "@standard-schema/spec";
66
import { ErrorResponse } from "../schema";
77
import type { HttpStatus } from "../status";
8-
import "./file-list-polyfill";
98

109
describe("Types", () => {
1110
describe("MergeRoutes", () => {

src/internal/serialization.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export function smartSerialize(value: unknown):
2222
};
2323
}
2424

25-
if (value instanceof FileList) {
25+
if (typeof FileList !== "undefined" && value instanceof FileList) {
2626
const serialized = new FormData();
2727
for (let i = 0; i < value.length; i++) {
2828
serialized.append("files", value.item(i)!);

0 commit comments

Comments
 (0)