Package: effect
Module: SchemaGetter
Encodes a nested object into a FormData instance using bracket-path notation.
When to use
Use when you need a schema getter to serialize structured data to FormData
for HTTP requests.
Details
The getter is pure and never fails. It flattens nested objects or arrays into
bracket-path keys such as user[name] and items[0]. Non-object inputs
produce an empty FormData.
Example (Encoding to FormData)
import { SchemaGetter } from "effect"
const encode = SchemaGetter.encodeFormData()
// Getter<FormData, unknown>
See
decodeFormData for the corresponding decodercollectBracketPathEntries for the underlying flattenerencodeURLSearchParams for the URLSearchParams variantSignature
declare const encodeFormData: () => Getter<FormData, unknown>
Since v4.0.0