()
| 1712 | * @since 4.0.0 |
| 1713 | */ |
| 1714 | export function encodeFormData(): Getter<FormData, unknown> { |
| 1715 | return transform((input) => { |
| 1716 | const out = new FormData() |
| 1717 | if (typeof input === "object" && input !== null) { |
| 1718 | const entries = collectFormDataEntries(input) |
| 1719 | entries.forEach(([key, value]) => { |
| 1720 | out.append(key, value) |
| 1721 | }) |
| 1722 | } |
| 1723 | return out |
| 1724 | }) |
| 1725 | } |
| 1726 | |
| 1727 | /** |
| 1728 | * Decodes a `URLSearchParams` object into a nested tree structure using bracket-path notation. |