Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
exotic / src / types / collection / fromPairsToMap.ts
Size: Mime:
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