scala-js / scala-js-dom

Statically typed DOM API for Scala.js
Other
315 stars 160 forks source link

Constructor parameters for URLSearchParams are not quite right #834

Closed steinybot closed 4 months ago

steinybot commented 4 months ago

URLSearchParams has:

  def this(init: Sequence[String]) = this()

where Sequence[String] is an alias for js.Array[String].

However this should be a sequence of string pairs not just strings, i.e. Sequence[js.Tuple2[String, String]].

https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams/URLSearchParams#options:

A literal sequence of name-value string pairs, or any object — such as a FormData object — with an iterator that produces a sequence of string pairs. Note that File entries will be serialized as [object File] rather than as their filename (as they would in an application/x-www-form-urlencoded form).