key-by.js 452 B

12345678910111213
  1. 'use strict';
  2. require('../../modules/es.map');
  3. require('../../modules/esnext.map.key-by');
  4. var call = require('../../internals/function-call');
  5. var isCallable = require('../../internals/is-callable');
  6. var path = require('../../internals/path');
  7. var Map = path.Map;
  8. var mapKeyBy = Map.keyBy;
  9. module.exports = function keyBy(source, iterable, keyDerivative) {
  10. return call(mapKeyBy, isCallable(this) ? this : Map, source, iterable, keyDerivative);
  11. };