You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The jsonMapper described in #40 and implemented in #43 has fallback mechanism that return null if parsing json failed.
Expected
Default response should be customisable by calling jsonMapper.default<TDefaultResult>(defaultResult: TDefaultResult) which produce mapper with return type TJsonResult | TDefaultResult.
Example usage:
conststatusMapper=jsonMapper.default<Stats>({views: 0,unique: 0,stars: 0})// returns default = {views: 0, unique:0, starts:0} for invalideconststats=statusMapper<Stats>('invalid');// returns parsed = {views: 1234, unique:10, starts:40}conststats2=statusMapper<Stats>('{"views": 123, "unique":10, "starts":40}');// in a config: (column definition for vertical list)// {key:"stats", index:5, mapper: jsonMapper.default<Stats>({views: 0, unique: 0, stars: 0})}
Actual
The
jsonMapper
described in #40 and implemented in #43 has fallback mechanism that returnnull
if parsing json failed.Expected
Default response should be customisable by calling
jsonMapper.default<TDefaultResult>(defaultResult: TDefaultResult)
which produce mapper with return typeTJsonResult | TDefaultResult
.Example usage:
TODO:
default
jsonMapper
created by the factoryThe text was updated successfully, but these errors were encountered: