DynamicForm.Helpers.Map (DynamicForm v1.0.0)

Copy Markdown View Source

Generic map utilities shared across the library.

Internal module — not part of the public API.

Summary

Functions

Recursively converts all map keys to strings, descending into nested maps and lists.

Puts value under key unless the value is nil.

Converts the top-level keys of a map to strings, leaving values untouched.

Functions

deep_stringify_keys(value)

Recursively converts all map keys to strings, descending into nested maps and lists.

Decimal values pass through untouched; any other struct is converted to a plain map (dropping __struct__) and descended into. Non-map, non-list values are returned as-is.

put_unless_nil(map, key, value)

Puts value under key unless the value is nil.

false and other falsy-looking values are still put — only nil is skipped.

stringify_keys(struct)

Converts the top-level keys of a map to strings, leaving values untouched.

Structs are converted to plain maps first.