@twin.org/entity-storage-connector-memory 0.0.1-next.23 → 0.0.1-next.24

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.
@@ -69,14 +69,15 @@ class MemoryEntityStorageConnector {
69
69
  * @param conditions The optional conditions to match for the entities.
70
70
  * @returns The id of the entity.
71
71
  */
72
- async set(entity, conditions) {
73
- core.Guards.object(this.CLASS_NAME, "entity", entity);
74
- const existingIndex = this.findItem(entity[this._primaryKey.property], undefined, conditions);
72
+ async set(entity$1, conditions) {
73
+ core.Guards.object(this.CLASS_NAME, "entity", entity$1);
74
+ entity.EntitySchemaHelper.validateEntity(entity$1, this.getSchema());
75
+ const existingIndex = this.findItem(entity$1[this._primaryKey.property], undefined, conditions);
75
76
  if (existingIndex >= 0) {
76
- this._store[existingIndex] = entity;
77
+ this._store[existingIndex] = entity$1;
77
78
  }
78
79
  else {
79
- this._store.push(entity);
80
+ this._store.push(entity$1);
80
81
  }
81
82
  }
82
83
  /**
@@ -69,6 +69,7 @@ class MemoryEntityStorageConnector {
69
69
  */
70
70
  async set(entity, conditions) {
71
71
  Guards.object(this.CLASS_NAME, "entity", entity);
72
+ EntitySchemaHelper.validateEntity(entity, this.getSchema());
72
73
  const existingIndex = this.findItem(entity[this._primaryKey.property], undefined, conditions);
73
74
  if (existingIndex >= 0) {
74
75
  this._store[existingIndex] = entity;
package/docs/changelog.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # @twin.org/entity-storage-connector-memory - Changelog
2
2
 
3
- ## v0.0.1-next.23
3
+ ## v0.0.1-next.24
4
4
 
5
5
  - Initial Release
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/entity-storage-connector-memory",
3
- "version": "0.0.1-next.23",
3
+ "version": "0.0.1-next.24",
4
4
  "description": "Entity Storage connector implementation using in-memory storage",
5
5
  "repository": {
6
6
  "type": "git",
@@ -16,7 +16,7 @@
16
16
  "dependencies": {
17
17
  "@twin.org/core": "next",
18
18
  "@twin.org/entity": "next",
19
- "@twin.org/entity-storage-models": "0.0.1-next.23",
19
+ "@twin.org/entity-storage-models": "0.0.1-next.24",
20
20
  "@twin.org/nameof": "next"
21
21
  },
22
22
  "main": "./dist/cjs/index.cjs",