Skip to content

Commit

Permalink
fix: serialize dates too (#192)
Browse files Browse the repository at this point in the history
  • Loading branch information
VanishMax authored Dec 9, 2024
1 parent e031206 commit 6b1110a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/shared/utils/serializer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ export const serialize = <VAL>(value: VAL): Serialized<VAL> => {
return value.map(v => serialize(v) as Serialized<unknown>) as Serialized<VAL>;
}

if (value instanceof Date) {
return value.toString() as Serialized<VAL>;
}

if (isMessage(value)) {
return {
proto: value.getType().typeName,
Expand Down

0 comments on commit 6b1110a

Please sign in to comment.