@keltoi/hydra 2.5.2 → 2.5.3

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.
Files changed (2) hide show
  1. package/index.js +7 -3
  2. 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,8 +328,12 @@ 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
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@keltoi/hydra",
3
- "version": "2.5.2",
3
+ "version": "2.5.3",
4
4
  "description": "Boilerplate to start your API from zero using Repository Pattern",
5
5
  "main": "index.js",
6
6
  "module": "index.js",