diff --git a/.changeset/mean-deers-drop.md b/.changeset/mean-deers-drop.md new file mode 100644 index 00000000..60d63c4b --- /dev/null +++ b/.changeset/mean-deers-drop.md @@ -0,0 +1,5 @@ +--- +"@cloudflare/workers-types": patch +--- + +fix: FormData::entries(), FormData::[Symbol.iterator]() diff --git a/.github/workflows/typechecks.yml b/.github/workflows/checks.yml similarity index 95% rename from .github/workflows/typechecks.yml rename to .github/workflows/checks.yml index 812a8c3a..267213c1 100644 --- a/.github/workflows/typechecks.yml +++ b/.github/workflows/checks.yml @@ -1,4 +1,4 @@ -name: Tests, Linter & Typecheck +name: Checks on: pull_request diff --git a/overrides/http.d.ts b/overrides/http.d.ts index ffbf5608..2854f326 100644 --- a/overrides/http.d.ts +++ b/overrides/http.d.ts @@ -9,8 +9,8 @@ declare class FormData { set(name: string, value: string): void; set(name: string, value: Blob, filename?: string): void; - entries(): IterableIterator<[key: string, value: File | string][]>; - [Symbol.iterator](): IterableIterator<[key: string, value: File | string][]>; + entries(): IterableIterator<[key: string, value: File | string]>; + [Symbol.iterator](): IterableIterator<[key: string, value: File | string]>; forEach( callback: ( diff --git a/tests/http.ts b/tests/http.ts new file mode 100644 index 00000000..e8441d84 --- /dev/null +++ b/tests/http.ts @@ -0,0 +1,12 @@ +const formData = new FormData(); + +const data: { [key: string]: string | File } = {}; +for (const [key, value] of formData.entries()) { + // data[key] = value; // TODO: this should be uncommented +} + +for (const [key, value] of formData) { + // data[key] = value; // TODO: this should be uncommented +} + +export {};