Skip to content

Commit

Permalink
Hotfix
Browse files Browse the repository at this point in the history
  • Loading branch information
mantoci committed Jul 8, 2022
1 parent 71edf30 commit a993641
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/either/serializer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ const stringify = <T>(value: T): string => {

if (isEither(value)) {
const variant = value.isRight ? 'Right' : 'Left'
return wrap(variant, stringify(value.fold()))
return wrap(
variant,
value.fold(() => '', stringify)
)
}

return JSON.stringify(value)
Expand Down

0 comments on commit a993641

Please sign in to comment.