@koalarx/nest 3.1.46 → 3.1.48

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.
@@ -128,6 +128,14 @@ class EntityBase {
128
128
  this[key] = props[key];
129
129
  }
130
130
  }
131
+ if (!this._id) {
132
+ const idConfig = Reflect.getMetadata('entity:id', this.constructor.prototype);
133
+ if (idConfig && idConfig.composite) {
134
+ this._id = idConfig.composite
135
+ .map((idPart) => this[idPart])
136
+ .join('-');
137
+ }
138
+ }
131
139
  }
132
140
  }
133
141
  equals(obj) {
@@ -17,8 +17,7 @@ class List {
17
17
  return list
18
18
  .filter((i) => i instanceof entity_base_1.EntityBase)
19
19
  .filter((i) => !!i._id)
20
- .findIndex((i) => item._id === i._id ||
21
- item.id === i.id);
20
+ .findIndex((i) => item._id === i._id);
22
21
  }
23
22
  return list
24
23
  .filter((i) => !(i instanceof entity_base_1.EntityBase))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@koalarx/nest",
3
- "version": "3.1.46",
3
+ "version": "3.1.48",
4
4
  "description": "",
5
5
  "author": "Igor D. Rangel",
6
6
  "license": "MIT",