@keltoi/hydra 2.5.2 → 2.5.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.
- package/index.js +11 -7
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -212,7 +212,7 @@ class Traceable extends Entity{
|
|
|
212
212
|
}){
|
|
213
213
|
super(key,struct);
|
|
214
214
|
|
|
215
|
-
this.#createdAt = createdAt;
|
|
215
|
+
this.#createdAt = createdAt instanceof Date ? createdAt : new Date(createdAt);
|
|
216
216
|
}
|
|
217
217
|
|
|
218
218
|
get createdAt(){ return this.#createdAt }
|
|
@@ -328,18 +328,22 @@ class Changeable extends Entity{
|
|
|
328
328
|
struct
|
|
329
329
|
);
|
|
330
330
|
|
|
331
|
-
this.#createdAt = createdAt;
|
|
332
|
-
this.#updatedAt = updatedAt
|
|
331
|
+
this.#createdAt = createdAt instanceof Date ? createdAt : new Date(createdAt);
|
|
332
|
+
this.#updatedAt = updatedAt instanceof Date
|
|
333
|
+
? updatedAt
|
|
334
|
+
: !!updatedAt
|
|
335
|
+
? new Date(updatedAt)
|
|
336
|
+
: undefined;
|
|
333
337
|
this.#active = active;
|
|
334
338
|
}
|
|
335
339
|
|
|
336
|
-
get createdAt(){ return this
|
|
337
|
-
get updatedAt(){ return this
|
|
338
|
-
get active(){ return this
|
|
340
|
+
get createdAt(){ return this.#createdAt }
|
|
341
|
+
get updatedAt(){ return this.#updatedAt}
|
|
342
|
+
get active(){ return this.#active }
|
|
339
343
|
|
|
340
344
|
get change(){
|
|
341
345
|
return {
|
|
342
|
-
updatedAt: this
|
|
346
|
+
updatedAt: this.#updatedAt
|
|
343
347
|
}
|
|
344
348
|
}
|
|
345
349
|
|