@ddd-ts/store-inmemory 0.0.0-eventviz.12 → 0.0.0-eventviz.4

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.
@@ -1,8 +1,8 @@
1
- require("./store/in-memory.database.js");
1
+ require('./store/in-memory.database.js');
2
2
  let _ddd_ts_core = require("@ddd-ts/core");
3
+
3
4
  //#region src/in-memory.transaction.ts
4
5
  var InMemoryTransaction = class {
5
- transaction;
6
6
  commitListeners = [];
7
7
  constructor(transaction) {
8
8
  this.transaction = transaction;
@@ -29,7 +29,8 @@ var FakeInMemoryTransactionPerformer = class extends _ddd_ts_core.TransactionPer
29
29
  super((effect) => effect(new InMemoryTransaction(null)));
30
30
  }
31
31
  };
32
+
32
33
  //#endregion
33
34
  exports.FakeInMemoryTransactionPerformer = FakeInMemoryTransactionPerformer;
34
35
  exports.InMemoryTransaction = InMemoryTransaction;
35
- exports.InMemoryTransactionPerformer = InMemoryTransactionPerformer;
36
+ exports.InMemoryTransactionPerformer = InMemoryTransactionPerformer;
@@ -1,8 +1,8 @@
1
1
  import "./store/in-memory.database.mjs";
2
2
  import { TransactionPerformer } from "@ddd-ts/core";
3
+
3
4
  //#region src/in-memory.transaction.ts
4
5
  var InMemoryTransaction = class {
5
- transaction;
6
6
  commitListeners = [];
7
7
  constructor(transaction) {
8
8
  this.transaction = transaction;
@@ -29,5 +29,6 @@ var FakeInMemoryTransactionPerformer = class extends TransactionPerformer {
29
29
  super((effect) => effect(new InMemoryTransaction(null)));
30
30
  }
31
31
  };
32
+
32
33
  //#endregion
33
- export { FakeInMemoryTransactionPerformer, InMemoryTransaction, InMemoryTransactionPerformer };
34
+ export { FakeInMemoryTransactionPerformer, InMemoryTransaction, InMemoryTransactionPerformer };
package/dist/index.js CHANGED
@@ -1,7 +1,8 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_in_memory_database = require("./store/in-memory.database.js");
3
- const require_in_memory_transaction = require("./in-memory.transaction.js");
4
- const require_in_memory_store = require("./store/in-memory.store.js");
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_in_memory_database = require('./store/in-memory.database.js');
3
+ const require_in_memory_transaction = require('./in-memory.transaction.js');
4
+ const require_in_memory_store = require('./store/in-memory.store.js');
5
+
5
6
  exports.CannotReadAfterWrites = require_in_memory_database.CannotReadAfterWrites;
6
7
  exports.FakeInMemoryTransactionPerformer = require_in_memory_transaction.FakeInMemoryTransactionPerformer;
7
8
  exports.InMemoryDatabase = require_in_memory_database.InMemoryDatabase;
@@ -9,4 +10,4 @@ exports.InMemoryStore = require_in_memory_store.InMemoryStore;
9
10
  exports.InMemoryTransaction = require_in_memory_transaction.InMemoryTransaction;
10
11
  exports.InMemoryTransactionPerformer = require_in_memory_transaction.InMemoryTransactionPerformer;
11
12
  exports.InMemoryUnderlyingTransaction = require_in_memory_database.InMemoryUnderlyingTransaction;
12
- exports.TransactionCollidedTooManyTimes = require_in_memory_database.TransactionCollidedTooManyTimes;
13
+ exports.TransactionCollidedTooManyTimes = require_in_memory_database.TransactionCollidedTooManyTimes;
package/dist/index.mjs CHANGED
@@ -1,4 +1,5 @@
1
1
  import { CannotReadAfterWrites, InMemoryDatabase, InMemoryUnderlyingTransaction, TransactionCollidedTooManyTimes } from "./store/in-memory.database.mjs";
2
2
  import { FakeInMemoryTransactionPerformer, InMemoryTransaction, InMemoryTransactionPerformer } from "./in-memory.transaction.mjs";
3
3
  import { InMemoryStore } from "./store/in-memory.store.mjs";
4
- export { CannotReadAfterWrites, FakeInMemoryTransactionPerformer, InMemoryDatabase, InMemoryStore, InMemoryTransaction, InMemoryTransactionPerformer, InMemoryUnderlyingTransaction, TransactionCollidedTooManyTimes };
4
+
5
+ export { CannotReadAfterWrites, FakeInMemoryTransactionPerformer, InMemoryDatabase, InMemoryStore, InMemoryTransaction, InMemoryTransactionPerformer, InMemoryUnderlyingTransaction, TransactionCollidedTooManyTimes };
@@ -1,10 +1,10 @@
1
+
1
2
  //#region src/store/in-memory.collection.ts
2
3
  function now() {
3
4
  if (typeof process === "object" && typeof process.hrtime === "function") return process.hrtime.bigint() / BigInt(1e3);
4
5
  return BigInt(Date.now() * 1e3);
5
6
  }
6
7
  var Collection = class Collection {
7
- data;
8
8
  constructor(data = /* @__PURE__ */ new Map()) {
9
9
  this.data = data;
10
10
  }
@@ -60,5 +60,6 @@ function replaceBigInt(key, value) {
60
60
  if (typeof value === "bigint") return value.toString();
61
61
  return value;
62
62
  }
63
+
63
64
  //#endregion
64
- exports.Collection = Collection;
65
+ exports.Collection = Collection;
@@ -4,7 +4,6 @@ function now() {
4
4
  return BigInt(Date.now() * 1e3);
5
5
  }
6
6
  var Collection = class Collection {
7
- data;
8
7
  constructor(data = /* @__PURE__ */ new Map()) {
9
8
  this.data = data;
10
9
  }
@@ -60,5 +59,6 @@ function replaceBigInt(key, value) {
60
59
  if (typeof value === "bigint") return value.toString();
61
60
  return value;
62
61
  }
62
+
63
63
  //#endregion
64
- export { Collection };
64
+ export { Collection };
@@ -1,7 +1,8 @@
1
- const require_in_memory_storage = require("./in-memory.storage.js");
2
- const require_in_memory_transaction = require("../in-memory.transaction.js");
3
- require("../index.js");
1
+ const require_in_memory_storage = require('./in-memory.storage.js');
2
+ const require_in_memory_transaction = require('../in-memory.transaction.js');
3
+ require('../index.js');
4
4
  let _ddd_ts_core = require("@ddd-ts/core");
5
+
5
6
  //#region src/store/in-memory.database.ts
6
7
  var CannotReadAfterWrites = class extends Error {
7
8
  constructor() {
@@ -146,8 +147,9 @@ var InMemoryDatabase = class InMemoryDatabase {
146
147
  console.log(["Database:", this.storage.toPretty()].join("\n"));
147
148
  }
148
149
  };
150
+
149
151
  //#endregion
150
152
  exports.CannotReadAfterWrites = CannotReadAfterWrites;
151
153
  exports.InMemoryDatabase = InMemoryDatabase;
152
154
  exports.InMemoryUnderlyingTransaction = InMemoryUnderlyingTransaction;
153
- exports.TransactionCollidedTooManyTimes = TransactionCollidedTooManyTimes;
155
+ exports.TransactionCollidedTooManyTimes = TransactionCollidedTooManyTimes;
@@ -2,6 +2,7 @@ import { Storage } from "./in-memory.storage.mjs";
2
2
  import { InMemoryTransaction } from "../in-memory.transaction.mjs";
3
3
  import "../index.mjs";
4
4
  import { ConcurrencyError } from "@ddd-ts/core";
5
+
5
6
  //#region src/store/in-memory.database.ts
6
7
  var CannotReadAfterWrites = class extends Error {
7
8
  constructor() {
@@ -146,5 +147,6 @@ var InMemoryDatabase = class InMemoryDatabase {
146
147
  console.log(["Database:", this.storage.toPretty()].join("\n"));
147
148
  }
148
149
  };
150
+
149
151
  //#endregion
150
- export { CannotReadAfterWrites, InMemoryDatabase, InMemoryUnderlyingTransaction, TransactionCollidedTooManyTimes };
152
+ export { CannotReadAfterWrites, InMemoryDatabase, InMemoryUnderlyingTransaction, TransactionCollidedTooManyTimes };
@@ -1,7 +1,7 @@
1
- const require_in_memory_collection = require("./in-memory.collection.js");
1
+ const require_in_memory_collection = require('./in-memory.collection.js');
2
+
2
3
  //#region src/store/in-memory.storage.ts
3
4
  var Storage = class Storage {
4
- collections;
5
5
  constructor(collections = /* @__PURE__ */ new Map()) {
6
6
  this.collections = collections;
7
7
  }
@@ -26,5 +26,6 @@ var Storage = class Storage {
26
26
  }).join("\n");
27
27
  }
28
28
  };
29
+
29
30
  //#endregion
30
- exports.Storage = Storage;
31
+ exports.Storage = Storage;
@@ -1,7 +1,7 @@
1
1
  import { Collection } from "./in-memory.collection.mjs";
2
+
2
3
  //#region src/store/in-memory.storage.ts
3
4
  var Storage = class Storage {
4
- collections;
5
5
  constructor(collections = /* @__PURE__ */ new Map()) {
6
6
  this.collections = collections;
7
7
  }
@@ -26,5 +26,6 @@ var Storage = class Storage {
26
26
  }).join("\n");
27
27
  }
28
28
  };
29
+
29
30
  //#endregion
30
- export { Storage };
31
+ export { Storage };
@@ -1,15 +1,12 @@
1
- require("./in-memory.database.js");
2
- require("../in-memory.transaction.js");
1
+ require('./in-memory.database.js');
2
+ require('../in-memory.transaction.js');
3
+
3
4
  //#region src/store/in-memory.store.ts
4
5
  /**
5
6
  * This in memory store is a copy store. It stores a copy of the actual model.
6
7
  * It is the recommended inmemory store to use, as it reflects more closely the behaviour of a real store.
7
8
  */
8
9
  var InMemoryStore = class {
9
- collection;
10
- database;
11
- serializer;
12
- $name;
13
10
  constructor(collection, database, serializer, $name) {
14
11
  this.collection = collection;
15
12
  this.database = database;
@@ -78,5 +75,6 @@ var InMemoryStore = class {
78
75
  for (const item of await this.filter(() => true)) yield item;
79
76
  }
80
77
  };
78
+
81
79
  //#endregion
82
- exports.InMemoryStore = InMemoryStore;
80
+ exports.InMemoryStore = InMemoryStore;
@@ -1,15 +1,12 @@
1
1
  import "./in-memory.database.mjs";
2
2
  import "../in-memory.transaction.mjs";
3
+
3
4
  //#region src/store/in-memory.store.ts
4
5
  /**
5
6
  * This in memory store is a copy store. It stores a copy of the actual model.
6
7
  * It is the recommended inmemory store to use, as it reflects more closely the behaviour of a real store.
7
8
  */
8
9
  var InMemoryStore = class {
9
- collection;
10
- database;
11
- serializer;
12
- $name;
13
10
  constructor(collection, database, serializer, $name) {
14
11
  this.collection = collection;
15
12
  this.database = database;
@@ -78,5 +75,6 @@ var InMemoryStore = class {
78
75
  for (const item of await this.filter(() => true)) yield item;
79
76
  }
80
77
  };
78
+
81
79
  //#endregion
82
- export { InMemoryStore };
80
+ export { InMemoryStore };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ddd-ts/store-inmemory",
3
- "version": "0.0.0-eventviz.12",
3
+ "version": "0.0.0-eventviz.4",
4
4
  "types": "dist/index.d.ts",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -10,11 +10,11 @@
10
10
  "dist"
11
11
  ],
12
12
  "dependencies": {
13
- "@ddd-ts/core": "0.0.0-eventviz.12"
13
+ "@ddd-ts/core": "0.0.0-eventviz.4"
14
14
  },
15
15
  "devDependencies": {
16
- "@ddd-ts/tools": "0.0.0-eventviz.12",
17
- "@ddd-ts/types": "0.0.0-eventviz.12",
16
+ "@ddd-ts/tools": "0.0.0-eventviz.4",
17
+ "@ddd-ts/types": "0.0.0-eventviz.4",
18
18
  "@types/jest": "^29.5.1",
19
19
  "@types/node": "^20.12.4"
20
20
  },