transformers/map library
Map and structure transformers.
This file contains transformers for working with Map structures, including picking keys, plucking values, and flattening nested maps.
Functions
-
flattenMapKeys(
String delimiter, IValidator child, {String? message}) → IValidator -
Flattens a nested Map structure into a single-level Map using the provided
delimiter
. Only flattens nested Maps (non-Map values become leaves). Arrays/lists are left as-is. -
getField(
String key, IValidator inner) → IValidator - Extracts and validates a field from a map.
-
pickKeys(
Iterable< String> keys, IValidator child, {String? message}) → IValidator - Picks a subset of keys from a Map, producing a new Map with only those keys present (if they existed). Fails if input is not a Map.
-
pluckKey(
String key, IValidator child, {String? message}) → IValidator - Plucks a single key's value from a Map (similar to getField but transform style).