Repository URL to install this package:
|
Version:
2.0.1 ▾
|
import { forOwn } from '../../deps'
import { PairedArray } from '../array/pairs/Pairs.typings'
// Array => Map
const fromPairsToMap = <Key, Value>(
x: PairedArray<Key, Value>
): Map<Key, Value> => {
const map = new Map()
forOwn(x, pair => {
const [key, value] = pair
map.set(key, value)
})
return map
}
export { fromPairsToMap }
export default fromPairsToMap