Liking cljdoc? Tell your friends :D

martian.parameter-aliases


alias-schemaclj/s

(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`.
sourceraw docstring

aliases-hash-mapclj/s

(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.
sourceraw docstring

parameter-aliasesclj/s

source

registryclj/s

(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`.
sourceraw docstring

unalias-dataclj/s

(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`.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close