Flattener
Last updated
Last updated
[data/tree/Flattener]
Flattens a tree into a flat dictionary with keys created by prepending parent keys and a delimiter to child keys recursively. Example:
{"a": {"a1": 1, "a2":2}}@0 is received via tree
"-"@0 is received via delimiter
{"a-a1": 1, "a-a2":2}@0 is sent via flattened
Keywords: flatten, tree, transform
tree: (any[] or {string: any})
The tree to flatten
delimiter: string
The delimiter to use when prepending parent keys to child keys
flattened: {string: any}
The flat dictionary