esnext.array.group-by-to-map.js 648 B

123456789101112131415
  1. // TODO: Remove from `core-js@4`
  2. var $ = require('../internals/export');
  3. var arrayMethodIsStrict = require('../internals/array-method-is-strict');
  4. var addToUnscopables = require('../internals/add-to-unscopables');
  5. var $groupToMap = require('../internals/array-group-to-map');
  6. var IS_PURE = require('../internals/is-pure');
  7. // `Array.prototype.groupByToMap` method
  8. // https://github.com/tc39/proposal-array-grouping
  9. // https://bugs.webkit.org/show_bug.cgi?id=236541
  10. $({ target: 'Array', proto: true, name: 'groupToMap', forced: IS_PURE || !arrayMethodIsStrict('groupByToMap') }, {
  11. groupByToMap: $groupToMap
  12. });
  13. addToUnscopables('groupByToMap');