Tinkex.Transform (Tinkex v0.3.4)

View Source

Lightweight serialization helpers for request payloads.

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

Summary

Functions

Transform a payload into a JSON-friendly map.

Types

format()

@type format() :: :iso8601 | (term() -> term())

opts()

@type opts() :: [aliases: map(), formats: map(), drop_nil?: boolean()]

Functions

transform(data, opts \\ [])

@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)