@glissandoo/lib 1.1.11 → 1.1.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -32,9 +32,9 @@ export default class Communication extends Model<CommunicationData> {
32
32
  get editedAt(): FirebaseFirestore.Timestamp | null;
33
33
  /** @deprecated use reactions */
34
34
  get totalClaps(): number;
35
- get reactions(): [string, string[]][];
35
+ get reactions(): Record<string, string[]>;
36
36
  get totalViews(): number;
37
37
  get isServer(): boolean;
38
38
  getRecipient: (userId: string) => import("./types").CommunicationRecipientData | null;
39
- getReactionsOrdered(maxItems?: number): [string, [string, string[]]][];
39
+ getReactionsOrdered(maxItems?: number): [string, string[]][];
40
40
  }
@@ -92,10 +92,9 @@ class Communication extends Model_1.default {
92
92
  .reduce((acc, current) => acc + current, 0);
93
93
  }
94
94
  get reactions() {
95
- const array = this.listRecipients.reduce((acc, { reaction, id }) => (Object.assign(Object.assign({}, acc), (reaction && {
95
+ return this.listRecipients.reduce((acc, { reaction, id }) => (Object.assign(Object.assign({}, acc), (reaction && {
96
96
  [reaction]: reaction in acc ? [...acc[reaction], id] : [id],
97
97
  }))), {});
98
- return lodash_1.sortBy(Object.entries(array), [(e) => e[1].length]);
99
98
  }
100
99
  get totalViews() {
101
100
  return this.listRecipients
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@glissandoo/lib",
3
- "version": "1.1.11",
3
+ "version": "1.1.12",
4
4
  "description": "Glissandoo library js",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",