-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: lib.d.tsThe issue relates to the different libraries shipped with TypeScriptThe issue relates to the different libraries shipped with TypeScript
Milestone
Description
TypeScript Version: 3.4.0-dev.20190323
Search Terms:
URLSearchParams, FormData
Code
let form = document.createElement('form')
console.log(new URLSearchParams(new FormData(form)))
Expected behavior:
compilation succeeds and an (empty) URLSearchParams
instance is constructed using the provided FormData
. The above code runs without issue on Chrome 73 and Firefox 67 for me.
Actual behavior:
compilation fails because URLSearchParams
doesn't explicitly allow an argument of type FormData
as input to the constructor.
Argument of type 'FormData' is not assignable to parameter of type 'string | Record<string, string> | URLSearchParams | string[][]'.
Property 'sort' is missing in type 'FormData' but required in type 'URLSearchParams'.
Playground Link:
link
florianajir, brumartins, WesleySmits, juniorUsca, stefanprobst and 28 more
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: lib.d.tsThe issue relates to the different libraries shipped with TypeScriptThe issue relates to the different libraries shipped with TypeScript