Skip to content

URLSearchParams #48142

Closed
Closed
@nmaves

Description

@nmaves

I feel like this might be missing a type. Per the MDN docs on URLSearchParams you should be able to initialize it with a FormData. I believe that we might want to add Iterable<[string, string]> or even just FormData to the allowed init types.

The code actually works but the types are not allowed. In your console, the following code works.

let formData = new FormData()
let urlSearchParams = new UrlSearchParams(formData)

TypeScript/lib/lib.dom.d.ts

Lines 14942 to 14946 in 20c93d3

declare var URLSearchParams: {
prototype: URLSearchParams;
new(init?: string[][] | Record<string, string> | string | URLSearchParams): URLSearchParams;
toString(): string;
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions