MCPcopy
hub / github.com/spicetify/cli / groupBy

Function groupBy

jsHelper/spicetifyWrapper.js:563–570  ·  view source on GitHub ↗
(values, keyFinder)

Source from the content-addressed store, hash-verified

561 });
562 // polyfill for chromium <117
563 const groupBy = (values, keyFinder) => {
564 if (typeof Object.groupBy === "function") return Object.groupBy(values, keyFinder);
565 return values.reduce((a, b) => {
566 const key = typeof keyFinder === "function" ? keyFinder(b) : b[keyFinder];
567 a[key] = a[key] ? [...a[key], b] : [b];
568 return a;
569 }, {});
570 };
571 const webpackFactories = new Set(Object.values(require.m));
572 const functionModules = modules.flatMap((module) =>
573 typeof module === "function"

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected