@koalarx/nest 3.1.18 → 3.1.19

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@koalarx/nest",
3
- "version": "3.1.18",
3
+ "version": "3.1.19",
4
4
  "description": "",
5
5
  "author": "Igor D. Rangel",
6
6
  "license": "MIT",
@@ -56,10 +56,12 @@ class InMemoryBaseRepository {
56
56
  }
57
57
  }
58
58
  getNewId() {
59
- return this.typeId === 'number'
60
- ? new KlArray_1.KlArray(this.items).orderBy('_id', 'desc')[0]?._id ??
61
- 0 + 1
62
- : (0, node_crypto_1.randomUUID)();
59
+ if (this.typeId === 'number') {
60
+ const lastId = new KlArray_1.KlArray(this.items).orderBy('_id', 'desc')[0]
61
+ ?._id;
62
+ return lastId ? lastId + 1 : 1;
63
+ }
64
+ return (0, node_crypto_1.randomUUID)();
63
65
  }
64
66
  }
65
67
  exports.InMemoryBaseRepository = InMemoryBaseRepository;