object.groupby
Version:
An ESnext spec-compliant `Object.groupBy` shim/polyfill/replacement that works as far down as ES3.
18 lines (12 loc) • 305 B
JavaScript
;
var define = require('define-properties');
var getPolyfill = require('./polyfill');
module.exports = function shim() {
var polyfill = getPolyfill();
define(
Object,
{ groupBy: polyfill },
{ groupBy: function () { return Object.groupBy !== polyfill; } }
);
return polyfill;
};