@uxland/primary-shell 5.3.2 → 5.3.3

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.
@@ -48,7 +48,7 @@ export declare const customFilterGroupsWithOptionsSelector: ((state: {
48
48
  filters: {
49
49
  options: {
50
50
  id: string;
51
- description: string;
51
+ title: string;
52
52
  }[];
53
53
  id: string;
54
54
  title: string;
@@ -72,7 +72,7 @@ export declare const customFilterGroupsWithOptionsSelector: ((state: {
72
72
  filters: {
73
73
  options: {
74
74
  id: string;
75
- description: string;
75
+ title: string;
76
76
  }[];
77
77
  id: string;
78
78
  title: string;
@@ -92,7 +92,7 @@ export declare const customFilterGroupsWithOptionsSelector: ((state: {
92
92
  filters: {
93
93
  options: {
94
94
  id: string;
95
- description: string;
95
+ title: string;
96
96
  }[];
97
97
  id: string;
98
98
  title: string;
@@ -116,7 +116,7 @@ export declare const customFilterGroupsWithOptionsSelector: ((state: {
116
116
  filters: {
117
117
  options: {
118
118
  id: string;
119
- description: string;
119
+ title: string;
120
120
  }[];
121
121
  id: string;
122
122
  title: string;
@@ -1,4 +1,4 @@
1
1
  export declare function getUniqueObjects<T>(items: T[], propPathId: string[], propPathDescription: string[]): {
2
2
  id: string;
3
- description: string;
3
+ title: string;
4
4
  }[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uxland/primary-shell",
3
- "version": "5.3.2",
3
+ "version": "5.3.3",
4
4
  "description": "Primaria Shell",
5
5
  "author": "UXLand <dev@uxland.es>",
6
6
  "homepage": "https://github.com/uxland/harmonix/tree/app#readme",
@@ -12,8 +12,8 @@ describe("getUniqueObjects", () => {
12
12
  const result = getUniqueObjects(items, ["data", "id"], ["data", "label"]);
13
13
 
14
14
  expect(result).toEqual([
15
- { id: "1", description: "Item 1 (duplicate)" }, // 👈 el último
16
- { id: "2", description: "Item 2" },
15
+ { id: "1", title: "Item 1 (duplicate)" }, // 👈 el último
16
+ { id: "2", title: "Item 2" },
17
17
  ]);
18
18
  });
19
19
 
@@ -26,7 +26,7 @@ describe("getUniqueObjects", () => {
26
26
 
27
27
  const result = getUniqueObjects(items, ["data", "id"], ["data", "label"]);
28
28
 
29
- expect(result).toEqual([{ id: "1", description: "Valid" }]);
29
+ expect(result).toEqual([{ id: "1", title: "Valid" }]);
30
30
  });
31
31
 
32
32
  it("should return an empty array if input is empty", () => {
@@ -43,8 +43,8 @@ describe("getUniqueObjects", () => {
43
43
  const result = getUniqueObjects(items, ["a", "b", "c", "id"], ["a", "b", "c", "name"]);
44
44
 
45
45
  expect(result).toEqual([
46
- { id: "x1", description: "Deep 1" },
47
- { id: "x2", description: "Deep 2" },
46
+ { id: "x1", title: "Deep 1" },
47
+ { id: "x2", title: "Deep 2" },
48
48
  ]);
49
49
  });
50
50
 
@@ -56,6 +56,6 @@ describe("getUniqueObjects", () => {
56
56
 
57
57
  const result = getUniqueObjects(items, ["a", "b", "id"], ["a", "b", "name"]);
58
58
 
59
- expect(result).toEqual([{ id: "1", description: "Good" }]);
59
+ expect(result).toEqual([{ id: "1", title: "Good" }]);
60
60
  });
61
61
  });
@@ -2,18 +2,15 @@ export function getUniqueObjects<T>(
2
2
  items: T[],
3
3
  propPathId: string[],
4
4
  propPathDescription: string[],
5
- ): { id: string; description: string }[] {
5
+ ): { id: string; title: string }[] {
6
6
  return Array.from(
7
7
  items
8
8
  .map((item) => ({
9
9
  id: propPathId.reduce((acc, key) => acc?.[key], item),
10
- description: propPathDescription.reduce((acc, key) => acc?.[key], item),
10
+ title: propPathDescription.reduce((acc, key) => acc?.[key], item),
11
11
  }))
12
- .filter((obj) => typeof obj.id === "string" && typeof obj.description === "string")
13
- .reduce(
14
- (map, obj) => map.set(obj.id, obj),
15
- new Map<string, { id: string; description: string }>(),
16
- )
12
+ .filter((obj) => typeof obj.id === "string" && typeof obj.title === "string")
13
+ .reduce((map, obj) => map.set(obj.id, obj), new Map<string, { id: string; title: string }>())
17
14
  .values(),
18
15
  );
19
16
  }