Skip to content

Commit

Permalink
fix helper func
Browse files Browse the repository at this point in the history
  • Loading branch information
henrikskog committed May 11, 2024
1 parent 71f8de3 commit 245f7ed
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/core/src/utils/db-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ export const fixJsonDatesStandardCols = <T extends { createdAt?: string | Date;
obj?: T | null | undefined
): T => {
let final = {}
if (obj?.createdAt instanceof Date) {
if (typeof obj?.createdAt === "string") {
final = {
createdAt: new Date(obj.createdAt),
}
}

if (obj?.updatedAt instanceof Date) {
if (typeof obj?.updatedAt === "string") {
final = {
...final,
updatedAt: new Date(obj.updatedAt),
Expand Down

0 comments on commit 245f7ed

Please sign in to comment.