@travetto/model 4.1.0 → 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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@travetto/model",
3
- "version": "4.1.0",
3
+ "version": "4.1.2",
4
4
  "description": "Datastore abstraction for core operations.",
5
5
  "keywords": [
6
6
  "datastore",
@@ -27,7 +27,7 @@ type StoreType = Map<string, Buffer>;
27
27
 
28
28
  @Config('model.memory')
29
29
  export class MemoryModelConfig {
30
- autoCreate?: boolean;
30
+ autoCreate?: boolean = true;
31
31
  namespace?: string;
32
32
  cullRate?: number | TimeSpan;
33
33
  }
@@ -105,6 +105,9 @@ export class MemoryModelService implements ModelCrudSupport, ModelStreamSupport,
105
105
  let index = this.#indices[idx.type].get(idxName)?.get(key);
106
106
 
107
107
  if (!index) {
108
+ if (!this.#indices[idx.type].has(idxName)) {
109
+ this.#indices[idx.type].set(idxName, new Map());
110
+ }
108
111
  if (idx.type === 'sorted') {
109
112
  this.#indices[idx.type].get(idxName)!.set(key, index = new Map());
110
113
  } else {