framework-do-dede 3.0.20 → 3.0.22

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.
@@ -7,6 +7,11 @@ export class Entity {
7
7
  let value = this[propName];
8
8
  if (typeof value === 'function')
9
9
  continue;
10
+ // @ts-ignore
11
+ if (this.constructor.strategyId === propName) {
12
+ result[propName] = this[propName].getValue();
13
+ continue;
14
+ }
10
15
  if (propertiesConfigs && propertiesConfigs[propName]?.serialize && value) {
11
16
  value = propertiesConfigs[propName].serialize(value);
12
17
  }
@@ -24,6 +29,11 @@ export class Entity {
24
29
  let value = this[propName];
25
30
  if (typeof value === 'function')
26
31
  continue;
32
+ // @ts-ignore
33
+ if (this.constructor.strategyId === propName) {
34
+ result[propName] = this[propName].getValue();
35
+ continue;
36
+ }
27
37
  if (propertiesConfigs && propertiesConfigs[propName]?.serialize && value) {
28
38
  value = await propertiesConfigs[propName].serialize(value);
29
39
  }
@@ -44,6 +54,11 @@ export class Entity {
44
54
  continue;
45
55
  if (typeof this[propName] === 'function')
46
56
  continue;
57
+ // @ts-ignore
58
+ if (this.constructor.strategyId === propName) {
59
+ result[propName] = this[propName].getValue();
60
+ continue;
61
+ }
47
62
  let value = this[propName];
48
63
  if (serialize && propertiesConfigs && propertiesConfigs[propName]?.serialize && value) {
49
64
  value = propertiesConfigs[propName].serialize(value);
@@ -70,6 +85,11 @@ export class Entity {
70
85
  continue;
71
86
  if (propertiesConfigs && propertiesConfigs[propName]?.restrict)
72
87
  continue;
88
+ // @ts-ignore
89
+ if (this.constructor.strategyId === propName) {
90
+ result[propName] = this[propName].getValue();
91
+ continue;
92
+ }
73
93
  let value = this[propName];
74
94
  if (serialize && propertiesConfigs && propertiesConfigs[propName]?.serialize && value) {
75
95
  value = await propertiesConfigs[propName].serialize(value);
@@ -87,15 +107,19 @@ export class Entity {
87
107
  }
88
108
  generateGetters() {
89
109
  // @ts-ignore
110
+ if (this.constructor.strategyId) {
111
+ // @ts-ignore
112
+ if (!this[`get${this.constructor.strategyId[0].toUpperCase()}${this.constructor.strategyId.slice(1)}`]) {
113
+ // @ts-ignore
114
+ this[`get${this.constructor.strategyId[0].toUpperCase()}${this.constructor.strategyId.slice(1)}`] = () => this[this.constructor.strategyId].getValue();
115
+ }
116
+ }
90
117
  for (const property of Object.keys(this)) {
91
118
  if (typeof property === 'function')
92
119
  continue;
93
120
  // @ts-ignore
94
- if (this.constructor.strategyId === property) {
95
- this[property] = this[property].getValue();
96
- this[`get${property[0].toUpperCase()}${property.slice(1)}`] = () => this[property];
121
+ if (this.constructor.strategyId === property)
97
122
  continue;
98
- }
99
123
  let prefixName = null;
100
124
  // @ts-ignore
101
125
  if (this.constructor.propertiesConfigs && this.constructor.propertiesConfigs[property] && this.constructor.propertiesConfigs[property].prefix) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "framework-do-dede",
3
- "version": "3.0.20",
3
+ "version": "3.0.22",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",