# `Sinter.Transform`
[🔗](https://github.com/nshkrdotcom/sinter/blob/v0.3.1/lib/sinter/transform.ex#L1)

Lightweight serialization helpers for request payloads.

- Drops `Sinter.NotGiven`/`Sinter.NotGiven.omit/0` sentinels
- Applies key aliases and simple formatters (e.g., ISO8601 timestamps)
- Recurses through maps, structs, and lists while stringifying keys

# `format`

```elixir
@type format() :: :iso8601 | (term() -&gt; term())
```

# `opts`

```elixir
@type opts() :: [
  aliases: map(),
  formats: map(),
  drop_nil?: boolean(),
  schema: Sinter.Schema.t() | nil,
  use_aliases: boolean()
]
```

# `transform`

```elixir
@spec transform(term(), opts()) :: term()
```

Transform a payload into a JSON-friendly map.

- Keys are stringified and alias mappings are applied
- `NotGiven`/`omit` sentinels are removed
- Optional formatters can be attached per key (`:iso8601` or a unary function)

## Options

  * `:aliases` - Map of canonical keys to alias keys
  * `:formats` - Map of keys to formatters
  * `:drop_nil?` - Whether to drop nil values (default: false)
  * `:schema` - A Sinter.Schema to extract aliases from
  * `:use_aliases` - Whether to use aliases from schema (default: false)

---

*Consult [api-reference.md](api-reference.md) for complete listing*
