utils/objecttomap
module
Functions
-
objectToMap( obj = { obj.[key: string] } ) → Map<string, T>
module:utils/objecttomap~objectToMap
Transforms object to map.
const map = objectToMap( { 'foo': 1, 'bar': 2 } ); map.get( 'foo' ); // 1
Note: For mixed data (
Object
orIterable
) there's a dedicatedtoMap
function.Type parameters
T
Parameters
obj : undefined | null | object
Object to transform.
Propertiesobj.[key: string] : T
Returns
Map<string, T>
Map created from object.