map-to-obj
v0.2.0
Published
ES2015 Map to plain object.
Downloads
34
Readme
map-to-obj
Install
yarn add map-to-obj
Usage
const mapToObj = require('map-to-obj')
const map = new Map([
['foo', 123],
['bar', 'hello']
])
map.set('foo', '123')
mapToObj(map)
//=>
{
foo: 123,
bar: 'hello'
}
Note: Don't use object
as key
, otherwise you will get [object Object]
in result object.
Contributing
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
Author
map-to-obj © egoist, Released under the MIT License. Authored and maintained by egoist with help from contributors (list).
egoistian.com · GitHub @egoist · Twitter @rem_rin_rin