Livex.ParamsMapper (livex v0.1.2)

Handles parameter mapping and type casting for Livex components and views.

This module is responsible for converting parameters between different formats and ensuring proper type casting based on component attribute definitions.

Summary

Functions

Cast a value to the specified type.

Decode a JSON string and verify its type.

Map and cast parameters for a given component, optionally scoped by an id.

Parse a string into a boolean value.

Parse an ISO formatted string using the provided function.

Safely convert a string to an existing atom.

Safely parse a value using the provided function.

Functions

cast(val, arg2)

@spec cast(any(), atom()) :: any()

Cast a value to the specified type.

decode_json(val, type_check)

Decode a JSON string and verify its type.

map_params(component, params, id \\ nil)

@spec map_params(module(), map() | nil, any() | nil) :: map()

Map and cast parameters for a given component, optionally scoped by an id.

parse_bool(val)

Parse a string into a boolean value.

parse_iso(fun, val)

Parse an ISO formatted string using the provided function.

safe_atom(val)

Safely convert a string to an existing atom.

safe_parse(fun, val)

Safely parse a value using the provided function.