We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d1c1d48 commit 687d495Copy full SHA for 687d495
src/parse.test.ts
@@ -104,6 +104,17 @@ describe("invalid key detection", () => {
104
expect(issue.key).toBe("");
105
expect(issue.path).toEqual([]);
106
});
107
+
108
+ it("handles non-string keys gracefully if they occur", () => {
109
+ const fd = new FormData();
110
+ // Handle cases where null or undefined keys might be injected
111
+ // by specific environments or legacy polyfills.
112
+ fd.append(null as any, "value");
113
114
+ const result = parse(fd);
115
+ expect(result.data).toBeNull();
116
+ expect(result.issues[0]?.code).toBe("invalid_key");
117
+ });
118
119
120
describe("boundary constraints", () => {
0 commit comments