@aws-amplify/analytics
Version:
Analytics category of aws-amplify
1 lines • 787 B
Source Map (JSON)
{"version":3,"file":"groupBy.mjs","sources":["../../../src/utils/groupBy.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nexport const groupBy = (getGroupId, list) => {\n return list.reduce((result, current) => {\n const groupId = getGroupId(current);\n return { ...result, [groupId]: [...(result[groupId] ?? []), current] };\n }, {});\n};\n"],"names":[],"mappings":"AAAA;AACA;AACY,MAAC,OAAO,GAAG,CAAC,UAAU,EAAE,IAAI,KAAK;AAC7C,IAAI,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,OAAO,KAAK;AAC5C,QAAQ,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO,CAAC;AAC3C,QAAQ,OAAO,EAAE,GAAG,MAAM,EAAE,CAAC,OAAO,GAAG,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,EAAE,OAAO,CAAC,EAAE;AAC9E,KAAK,EAAE,EAAE,CAAC;AACV;;;;"}