src/tinier.js
function keyBy (arr, key) {
  var obj = {}
  arr.map(x => obj[x[key]] = x)
  return obj
}
function keyBy (arr, key) {
  var obj = {}
  arr.map(x => obj[x[key]] = x)
  return obj
}
function keyBy ( arr , key ) { var obj = { } arr . map ( x => obj [ x [ key ] ] = x ) return obj }
Turn an array of objects into a new object of objects where the keys are
given by the value of `key` in each child object.
@param {[Object]} arr - The array of objects.
@param {String} key - The key to look for.
Turn an array of objects into a new object of objects where the keys are given by the value of key in each child object .