@thisisagile/easy 8.42.1 → 8.42.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.
@@ -2,5 +2,5 @@ import { Struct } from './Struct';
2
2
  import { Id, Json } from '../types';
3
3
  export declare abstract class Child extends Struct {
4
4
  readonly id: Id;
5
- protected merge: (a: Json) => Json;
5
+ protected merge: (a: unknown) => Json;
6
6
  }
@@ -17,7 +17,7 @@ class Child extends Struct_1.Struct {
17
17
  constructor() {
18
18
  super(...arguments);
19
19
  this.id = this.state.id ?? (0, types_1.toId)();
20
- this.merge = (a) => types_1.json.parse({ ...this, ...a, id: this.id });
20
+ this.merge = (a) => types_1.json.merge(this, a, { id: this.id });
21
21
  }
22
22
  }
23
23
  __decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"Child.js","sourceRoot":"","sources":["../../src/domain/Child.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAkC;AAClC,oCAAgD;AAChD,8CAAyC;AAEzC,MAAsB,KAAM,SAAQ,eAAM;IAA1C;;QACuB,OAAE,GAAO,IAAI,CAAC,KAAK,CAAC,EAAE,IAAI,IAAA,YAAI,GAAE,CAAC;QAC5C,UAAK,GAAG,CAAC,CAAO,EAAQ,EAAE,CAAC,YAAI,CAAC,KAAK,CAAC,EAAE,GAAG,IAAI,EAAE,GAAG,CAAC,EAAE,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;IAClF,CAAC;CAAA;AAFa;IAAX,IAAA,qBAAQ,GAAE;;iCAA2C;AADxD,sBAGC"}
1
+ {"version":3,"file":"Child.js","sourceRoot":"","sources":["../../src/domain/Child.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAkC;AAClC,oCAAgD;AAChD,8CAAyC;AAEzC,MAAsB,KAAM,SAAQ,eAAM;IAA1C;;QACuB,OAAE,GAAO,IAAI,CAAC,KAAK,CAAC,EAAE,IAAI,IAAA,YAAI,GAAE,CAAC;QAC5C,UAAK,GAAG,CAAC,CAAU,EAAQ,EAAE,CAAC,YAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;IAE/E,CAAC;CAAA;AAHa;IAAX,IAAA,qBAAQ,GAAE;;iCAA2C;AADxD,sBAIC"}
@@ -5,5 +5,5 @@ export declare abstract class Entity extends Struct {
5
5
  readonly id: Id;
6
6
  readonly created: Audit;
7
7
  readonly lastModified: Audit;
8
- protected merge: (a: Json) => Json;
8
+ protected merge: (a: unknown) => Json;
9
9
  }
@@ -20,13 +20,7 @@ class Entity extends Struct_1.Struct {
20
20
  this.id = this.state.id ?? (0, types_1.toId)();
21
21
  this.created = new Audit_1.Audit(this.state.created);
22
22
  this.lastModified = new Audit_1.Audit(this.state.lastModified);
23
- this.merge = (a) => types_1.json.parse({
24
- ...this,
25
- ...a,
26
- id: this.id,
27
- created: this.created.toJSON(),
28
- lastModified: new Audit_1.Audit().toJSON(),
29
- });
23
+ this.merge = (a) => types_1.json.merge(this, a, { id: this.id, created: this.created.toJSON(), lastModified: new Audit_1.Audit().toJSON() });
30
24
  }
31
25
  }
32
26
  __decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"Entity.js","sourceRoot":"","sources":["../../src/domain/Entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAkC;AAClC,oCAAgD;AAChD,8CAAyC;AACzC,mCAAgC;AAEhC,MAAsB,MAAO,SAAQ,eAAM;IAA3C;;QACuB,OAAE,GAAO,IAAI,CAAC,KAAK,CAAC,EAAE,IAAI,IAAA,YAAI,GAAE,CAAC;QACjC,YAAO,GAAU,IAAI,aAAK,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAC/C,iBAAY,GAAU,IAAI,aAAK,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;QAEpE,UAAK,GAAG,CAAC,CAAO,EAAQ,EAAE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,qBAAQ,GAAE;8BAAwB,aAAK;4CAAsC;AAHhF,wBAQC"}
@@ -6,5 +6,5 @@ export declare abstract class Struct implements Validatable {
6
6
  toJSON(): Json;
7
7
  toString(): string;
8
8
  update: (_add: Json) => Struct;
9
- protected merge: (a: Json) => Json;
9
+ protected merge: (a: unknown) => Json;
10
10
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Struct.js","sourceRoot":"","sources":["../../src/domain/Struct.ts"],"names":[],"mappings":";;;AAAA,oCAAmD;AACnD,8CAAyC;AAEzC,MAAsB,MAAM;IAC1B,YAA+B,QAAa,EAAE;QAAf,UAAK,GAAL,KAAK,CAAU;QAc9C,WAAM,GAAG,CAAC,IAAU,EAAU,EAAE,CAAC,IAAI,CAAC;QAE5B,UAAK,GAAG,CAAC,CAAO,EAAQ,EAAE,CAAC,YAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IAhBR,CAAC;IAElD,IAAI,OAAO;QACT,OAAO,IAAA,qBAAQ,EAAC,IAAI,CAAC,CAAC,OAAO,CAAC;IAChC,CAAC;IAED,MAAM;QACJ,OAAO,YAAI,CAAC,IAAI,CAAC,EAAE,GAAG,IAAI,EAAE,EAAE,OAAO,CAAC,CAAC;IACzC,CAAC;IAED,QAAQ;QACN,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;IAC/B,CAAC;CAKF;AAlBD,wBAkBC"}
1
+ {"version":3,"file":"Struct.js","sourceRoot":"","sources":["../../src/domain/Struct.ts"],"names":[],"mappings":";;;AAAA,oCAAmD;AACnD,8CAAyC;AAEzC,MAAsB,MAAM;IAC1B,YAA+B,QAAa,EAAE;QAAf,UAAK,GAAL,KAAK,CAAU;QAc9C,WAAM,GAAG,CAAC,IAAU,EAAU,EAAE,CAAC,IAAI,CAAC;QAE5B,UAAK,GAAG,CAAC,CAAU,EAAQ,EAAE,CAAC,YAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IAhBX,CAAC;IAElD,IAAI,OAAO;QACT,OAAO,IAAA,qBAAQ,EAAC,IAAI,CAAC,CAAC,OAAO,CAAC;IAChC,CAAC;IAED,MAAM;QACJ,OAAO,YAAI,CAAC,IAAI,CAAC,EAAE,GAAG,IAAI,EAAE,EAAE,OAAO,CAAC,CAAC;IACzC,CAAC;IAED,QAAQ;QACN,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;IAC/B,CAAC;CAKF;AAlBD,wBAkBC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thisisagile/easy",
3
- "version": "8.42.1",
3
+ "version": "8.42.2",
4
4
  "description": "Straightforward library for building domain-driven microservice architectures",
5
5
  "author": "Sander Hoogendoorn",
6
6
  "license": "MIT",
@@ -31,7 +31,7 @@
31
31
  "access": "public"
32
32
  },
33
33
  "devDependencies": {
34
- "@thisisagile/easy-test": "8.42.1",
34
+ "@thisisagile/easy-test": "8.42.2",
35
35
  "@types/form-urlencoded": "^4.4.0",
36
36
  "@types/jsonwebtoken": "^8.5.8",
37
37
  "@types/validator": "^13.7.1"
@@ -4,5 +4,6 @@ import { required } from '../validation';
4
4
 
5
5
  export abstract class Child extends Struct {
6
6
  @required() readonly id: Id = this.state.id ?? toId();
7
- protected merge = (a: Json): Json => json.parse({ ...this, ...a, id: this.id });
7
+ protected merge = (a: unknown): Json => json.merge(this, a, { id: this.id });
8
+ // protected merge = (a: unknown): Json => json.parse({ ...this, ...{ a as any }, id: this.id });
8
9
  }
@@ -8,12 +8,7 @@ export abstract class Entity extends Struct {
8
8
  @required() readonly created: Audit = new Audit(this.state.created);
9
9
  @required() readonly lastModified: Audit = new Audit(this.state.lastModified);
10
10
 
11
- protected merge = (a: Json): Json =>
12
- json.parse({
13
- ...this,
14
- ...a,
15
- id: this.id,
16
- created: this.created.toJSON(),
17
- lastModified: new Audit().toJSON(),
18
- });
11
+ protected merge = (a: unknown): Json =>
12
+ json.merge(this, a, { id: this.id, created: this.created.toJSON(), lastModified: new Audit().toJSON() });
13
+
19
14
  }
@@ -18,5 +18,5 @@ export abstract class Struct implements Validatable {
18
18
 
19
19
  update = (_add: Json): Struct => this;
20
20
 
21
- protected merge = (a: Json): Json => json.merge(this, a);
21
+ protected merge = (a: unknown): Json => json.merge(this, a);
22
22
  }