convert a hash to a collection
yarn add hash-to-collection
hashToCollection(hash, [keyName])
collection (Array): the collection to convert keyName (string): the key name your hash keys will be stored as (default: 'key')
import hashToCollection from 'hash-to-collection'
const hash = {
123: { ... },
abc: { ... }
}
const collection = hashToCollection(collection, 'uid')
/*
[{ uid: 123, ... }, { uid: 'abc', ... }]
*/
Contributions welcome! Please read the contributing guidelines first.