(key: string, value: FormDataValue)
| 53 | } |
| 54 | |
| 55 | append(key: string, value: FormDataValue) { |
| 56 | // The XMLHttpRequest spec doesn't specify if duplicate keys are allowed. |
| 57 | // MDN says that any new values should be appended to existing values. |
| 58 | // In any case, major browsers allow duplicate keys, so that's what we'll do |
| 59 | // too. They'll simply get appended as additional form data parts in the |
| 60 | // request body, leaving the server to deal with them. |
| 61 | this._parts.push([key, value]); |
| 62 | } |
| 63 | |
| 64 | getParts(): Array<FormDataPart> { |
| 65 | return this._parts.map(([name, value]) => { |
no test coverage detected