Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/tuckerconnelly/map-set-utils


https://github.com/tuckerconnelly/map-set-utils

Last synced: 23 days ago
JSON representation

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