Skip to content

Commit

Permalink
Fix deserializers in mapType documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthiasKunnen authored and Neos3452 committed Jan 28, 2021
1 parent f0038f5 commit 5d3aadd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,12 @@ import {jsonObject, jsonMember, TypedJSON} from 'typedjson';
import * as Decimal from 'decimal.js'; // Or any other library your type originates from

TypedJSON.mapType(BigInt, {
deserializer: json => value == null ? value : new BigInt(json),
deserializer: json => json == null ? json : BigInt(json),
serializer: value => value == null ? value : value.toString(),
});

TypedJSON.mapType(Decimal, {
deserializer: json => value == null ? value : new Decimal(json),
deserializer: json => json == null ? json : new Decimal(json),
serializer: value => value == null ? value : value.toString(),
});

Expand Down

0 comments on commit 5d3aadd

Please sign in to comment.