Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tuckerconnelly/map-set-utils
https://github.com/tuckerconnelly/map-set-utils
Last synced: 23 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/tuckerconnelly/map-set-utils
- Owner: tuckerconnelly
- License: mit
- Created: 2016-02-22T13:18:14.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-02-22T13:57:07.000Z (almost 9 years ago)
- Last Synced: 2024-09-19T05:42:20.569Z (3 months ago)
- Language: JavaScript
- Size: 3.91 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
mapset-utils
===========Utilities for Map and Set
## Functions
mapToObject - Converts a Map to an Object
```js
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
```js
import { objectToMap } from 'mapset-utils'const myObject = { foo: 'bar' }
const myMap = objectToMap(myObject)
myMap.get('foo') // bar
```## License
MIT