Converts object to entries, maps it with provided callback and flattens entry list.
Record like object
Record
map callback, accepts entry pair ([key, value]) and should return list of entry pairs
[key, value]
new mapped object
flatMapRecord({'a': 2}, ([k, v]) => [[k, v]])>> {'a': 2, 'b': 3}flatMapRecord({'a': 2, 'b': 3}, ([k, v]) => v === 2 ? [[k, v]] : [])>> {'a': 2} Copy
flatMapRecord({'a': 2}, ([k, v]) => [[k, v]])>> {'a': 2, 'b': 3}flatMapRecord({'a': 2, 'b': 3}, ([k, v]) => v === 2 ? [[k, v]] : [])>> {'a': 2}
Use [[flatMap]] from iterable instead — it handles Record directly along with Array, Set, Map, and (async) iterables.
iterable
Array
Set
Map
Converts object to entries, maps it with provided callback and flattens entry list.