eventsourcingdb 1.8.4 → 1.8.6

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/README.md CHANGED
@@ -515,7 +515,7 @@ const signingKey = container.getSigningKey();
515
515
  const verificationKey = container.getVerificationKey();
516
516
  ```
517
517
 
518
- The `signingKey` can be used when configuring the container to sign outgoing events. The `verificationKey` can be passed to `verifySignature` when verifying events read from the database.
518
+ The `signingKey` is the private key EventSourcingDB signs events with. The `verificationKey` can be passed to `verifySignature` when verifying events read from the database.
519
519
 
520
520
  #### Configuring the Client Manually
521
521
 
package/dist/Container.js CHANGED
@@ -84,10 +84,6 @@ class Container {
84
84
  if (this.#signingKey === undefined) {
85
85
  throw new Error('Signing key not set.');
86
86
  }
87
- // @types/node >= 26.0.0 dropped the KeyObject overload from createPublicKey,
88
- // even though Node accepts a (private) KeyObject at runtime to derive the public
89
- // key. Remove this suppression once DefinitelyTyped restores the overload.
90
- // @ts-expect-error
91
87
  const verificationKey = crypto.createPublicKey(this.#signingKey);
92
88
  return verificationKey;
93
89
  }
@@ -1,19 +1,19 @@
1
1
  import { isRecord } from './isRecord.js';
2
+ const isGuard = (value) => typeof value === 'function';
3
+ const isShape = (value) => isRecord(value);
2
4
  const hasShapeOf = (value, shape) => {
3
5
  if (!isRecord(value)) {
4
6
  return false;
5
7
  }
6
- for (const key of Object.keys(shape)) {
7
- const spec = shape[key];
8
+ for (const [key, spec] of Object.entries(shape)) {
8
9
  const val = value[key];
9
- if (typeof spec === 'function') {
10
- const guard = spec;
11
- if (!guard(val)) {
10
+ if (isGuard(spec)) {
11
+ if (!spec(val)) {
12
12
  return false;
13
13
  }
14
14
  continue;
15
15
  }
16
- if (!isRecord(val)) {
16
+ if (!(isRecord(val) && isShape(spec))) {
17
17
  return false;
18
18
  }
19
19
  if (!hasShapeOf(val, spec)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eventsourcingdb",
3
- "version": "1.8.4",
3
+ "version": "1.8.6",
4
4
  "description": "The official JavaScript client SDK for EventSourcingDB.",
5
5
  "author": {
6
6
  "name": "the native web GmbH",
@@ -21,10 +21,10 @@
21
21
  "testcontainers": "12.1.0"
22
22
  },
23
23
  "devDependencies": {
24
- "@biomejs/biome": "2.5.5",
25
- "@types/node": "26.1.1",
24
+ "@biomejs/biome": "2.5.14",
25
+ "@types/node": "26.6.1",
26
26
  "get-port": "7.2.0",
27
- "tsx": "4.23.1",
27
+ "tsx": "4.23.13",
28
28
  "typescript": "7.0.2"
29
29
  },
30
30
  "scripts": {