Skip to content

Commit

Permalink
[fix] ReadOnlyFormData types (#1830)
Browse files Browse the repository at this point in the history
Fix type errors inside ReadOnlyFormData that didn't allow it to be used inside for..of loops
  • Loading branch information
JeanJPNM authored Jul 6, 2021
1 parent 5b3e1e6 commit 8affef2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/real-pens-watch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sveltejs/kit': patch
---

Fix type errors inside ReadOnlyFormData that didn't allow it to be used inside for..of loops
9 changes: 5 additions & 4 deletions packages/kit/types/helper.d.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
interface ReadOnlyFormData extends Iterator<[string, string]> {
interface ReadOnlyFormData {
get: (key: string) => string;
getAll: (key: string) => string[];
has: (key: string) => boolean;
entries: () => Iterator<[string, string]>;
keys: () => Iterator<string>;
values: () => Iterator<string>;
entries: () => Generator<[string, string], void>;
keys: () => Generator<string, void>;
values: () => Generator<string, void>;
[Symbol.iterator]: () => Generator<[string, string], void>;
}

type BaseBody = string | Buffer | ReadOnlyFormData;
Expand Down

0 comments on commit 8affef2

Please sign in to comment.