com.walmartlabs.schematic.transform

added in 1.2.0

Utilities for transforming a Schematic configuration before it is assembled.

apply-xforms

(apply-xforms config xforms)

Applies a seq of transform functions to the components of the configuration.

Each xform function is passed a configuration map and returns the same, or a modified version.

extend-symbol

(extend-symbol namespace-prefix sym)

Transforms a qualified symbol, appending the namespace prefix and a dot, and possibly adding a map-> prefix to the name, if the symbol name starts with an upper case character (which is assumed to be the name of a record).

xform-constructor-fn

(xform-constructor-fn k namespace-prefix)

Returns a transform function for supporting concise constructor functions. The k key in a component, when present, is replaced with a :sc/create-fn key, where the value is extended via extend-symbol.

In practice, this means that the config can contain :foo/create-fn -> bar/Baz, which will be converted to :sc/create-fn -> org.example.bar/map->Baz (assuming a namespace prefix of org.example).

The namespace prefix may be a string or a symbol.