utils/tomap
module
Functions
-
toMap( data = { data.[key: string] } ) → Map<string, T>
module:utils/tomap~toMap
Transforms object or iterable to map. Iterable needs to be in the format acceptable by the
Map
constructor.map = toMap( { 'foo': 1, 'bar': 2 } ); map = toMap( [ [ 'foo', 1 ], [ 'bar', 2 ] ] ); map = toMap( anotherMap );
Type parameters
T
Parameters
data : undefined | null | object | Iterable<readonly tuple>
Object or iterable to transform.
Propertiesdata.[key: string] : T
Returns
Map<string, T>
Map created from data.