map-set-utils
v0.0.4
Published
Utilities for ES2015 Map and Set
Downloads
3
Readme
mapset-utils
Utilities for Map and Set
Functions
mapToObject - Converts a Map to an Object
import { mapToObject } from 'mapset-utils'
const myMap = new Map
myMap.set('foo', 'bar')
const myObject = mapToObject(myMap)
myObject.foo // bar
objectToMap - Converts an Object to a Map
import { objectToMap } from 'mapset-utils'
const myObject = { foo: 'bar' }
const myMap = objectToMap(myObject)
myMap.get('foo') // bar
License
MIT