(alias-schema registry schema)Given a (possibly, deeply nested) schema, renames all keys (in it and its
subschemas) into corresponding "idiomatic" keys (aliases) using the given
parameter aliases registry.
Given a (possibly, deeply nested) `schema`, renames all keys (in it and its subschemas) into corresponding "idiomatic" keys (aliases) using the given parameter aliases `registry`.
(aliases-hash-map schema)Eagerly computes the registry as a data structure for the given schema.
Produces a plain hash map with idiomatic keys (aliases) mappings per path
in a (possibly, deeply nested) schema for all its unqualified keys.
The result is then used with alias-schema and unalias-data functions.
Eagerly computes the registry as a data structure for the given `schema`. Produces a plain hash map with idiomatic keys (aliases) mappings per path in a (possibly, deeply nested) `schema` for all its unqualified keys. The result is then used with `alias-schema` and `unalias-data` functions.
(registry schema)Builds a lookupable registry of parameter alias maps for the given schema.
On JVM/CLJS: Returns an instance of a lazy registry.
Aliases are computed on demand (via compute-aliases-at), so materializing
massive alias maps upfront is avoided. Per-path results are memoized within
the registry. Identical alias maps are shared to cut memory usage.
A returned value implements ILookup and is indexed by "idiomatic paths".
Looking up a path gives an alias map for that level, mapping idiomatic keys
(kebab-case, unqualified) to their original schema keys.
On Babashka:
Returns a plain hash map registry that is computed eagerly via key-seqs.
Builds a lookupable registry of parameter alias maps for the given `schema`. - On JVM/CLJS: Returns an instance of a lazy registry. Aliases are computed on demand (via `compute-aliases-at`), so materializing massive alias maps upfront is avoided. Per-path results are memoized within the registry. Identical alias maps are shared to cut memory usage. A returned value implements `ILookup` and is indexed by "idiomatic paths". Looking up a path gives an alias map for that level, mapping idiomatic keys (kebab-case, unqualified) to their original schema keys. - On Babashka: Returns a plain hash map registry that is computed eagerly via `key-seqs`.
(unalias-data registry data)Given a (possibly, deeply nested) data structure, returns it with all its
keys renamed from "idiomatic" (aliases) using the given parameter aliases
registry.
Given a (possibly, deeply nested) `data` structure, returns it with all its keys renamed from "idiomatic" (aliases) using the given parameter aliases `registry`.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |