@travetto/model-redis 4.0.7 → 4.1.2

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.
Files changed (2) hide show
  1. package/package.json +5 -5
  2. package/src/service.ts +3 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@travetto/model-redis",
3
- "version": "4.0.7",
3
+ "version": "4.1.2",
4
4
  "description": "Redis backing for the travetto model module.",
5
5
  "keywords": [
6
6
  "typescript",
@@ -25,12 +25,12 @@
25
25
  "directory": "module/model-redis"
26
26
  },
27
27
  "dependencies": {
28
- "@travetto/config": "^4.0.7",
29
- "@travetto/model": "^4.0.7",
30
- "redis": "^4.6.13"
28
+ "@travetto/config": "^4.1.0",
29
+ "@travetto/model": "^4.1.2",
30
+ "redis": "^4.6.14"
31
31
  },
32
32
  "peerDependencies": {
33
- "@travetto/command": "^4.0.6"
33
+ "@travetto/command": "^4.1.0"
34
34
  },
35
35
  "peerDependenciesMeta": {
36
36
  "@travetto/command": {
package/src/service.ts CHANGED
@@ -105,17 +105,16 @@ export class RedisModelService implements ModelCrudSupport, ModelExpirySupport,
105
105
  // Store with indices
106
106
  if (config.indices?.length) {
107
107
  const multi = this.client.multi();
108
+ if (existing) {
109
+ this.#removeIndices(cls, existing, multi);
110
+ }
108
111
  switch (action) {
109
112
  case 'write': {
110
- if (existing) {
111
- this.#removeIndices(cls, existing, multi);
112
- }
113
113
  multi.set(key, JSON.stringify(item));
114
114
  this.#addIndices(cls, item, multi);
115
115
  break;
116
116
  }
117
117
  case 'delete': {
118
- this.#removeIndices(cls, existing!, multi);
119
118
  multi.del(key);
120
119
  break;
121
120
  }