Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

groupby-polyfill

jimmywarting89.1kMIT1.0.0

small zero dependent polyfill for Object.groupBy and Map.groupBy

groupBy, Object.groupBy, Map.groupBy, polyfill

readme

groupby-polyfill JSDoc icon, indicating that this package has built-in type declarations

A small polyfill with zero-dependency that do just do one thing.

npm install groupby-polyfill

This is a hybrid package. It dose not import or export anything so both require and import works.

This will conditionally polyfill global Object/Map with the missing groupBy method using ??= but I would recommend that you conditionally import it if it's needed. See comp. table at MDN if you need this:

Documentation and code example is in this links too.

Usage

Just need to import it.

import 'groupby-polyfill/lib/polyfill.js'