Skip to content

Commit b421047

Browse files
authored
fix: more robust custom serializer (#1689)
1 parent 042df7e commit b421047

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/runtime/src/browser/serialization.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ SuperJSON.registerCustom<Decimal, string>(
88
isApplicable: (v): v is Decimal =>
99
v instanceof Decimal ||
1010
// interop with decimal.js
11-
v.toStringTag === '[object Decimal]',
11+
v?.toStringTag === '[object Decimal]',
1212
serialize: (v) => v.toJSON(),
1313
deserialize: (v) => new Decimal(v),
1414
},

0 commit comments

Comments
 (0)