Skip to content

Commit 31c026c

Browse files
committed
Update FormData.scala - using function overloading
1 parent 1f3526c commit 31c026c

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

dom/src/main/scala/org/scalajs/dom/FormData.scala

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ import scala.scalajs.js.|
1919
class FormData(form: HTMLFormElement = js.native) extends js.Iterable[js.Tuple2[String, String]] {
2020

2121
/** Appends a key/value pair to the FormData object. */
22-
def append(name: js.Any, value: js.Any, blobName: String = js.native): Unit = js.native
22+
def append(name: js.Any, value: String): Unit = js.native
23+
24+
def append(name: js.Any, value: Blob, blobName: String): Unit = js.native
2325

2426
/** Deletes a key/value pair from the FormData object. */
2527
def delete(name: String): Unit = js.native
@@ -33,7 +35,11 @@ class FormData(form: HTMLFormElement = js.native) extends js.Iterable[js.Tuple2[
3335
/** Sets a new value for an existing key inside a FormData object, or adds the key/value if it does not already exist.
3436
*/
3537
def set(
36-
name: String, value: String | Blob, blobName: String = js.native
38+
name: String, value: String
39+
): Unit = js.native
40+
41+
def set(
42+
name: String, value: Blob, blobName: String
3743
): Unit = js.native
3844

3945
@JSName(js.Symbol.iterator)

0 commit comments

Comments
 (0)