MCPcopy Create free account
hub / github.com/Effect-TS/effect / encodeFormData

Function encodeFormData

packages/effect/src/SchemaGetter.ts:1714–1725  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1712 * @since 4.0.0
1713 */
1714export 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.

Callers

nothing calls this directly

Calls 2

transformFunction · 0.70
forEachMethod · 0.65

Tested by

no test coverage detected