Closed anymos closed 1 week ago
You can extends the JsonEncoder
and JsonDecoder
classes.
In JsonEncoder
overwrite the encodeUnknown
method:
class MyEncoder extends JsonEncoder {
encodeUnknown(value) {
if (typeof value === 'bigint') {
return String(value);
}
return super.encodeUnknown(value);
}
}
In the JsonDecoder
overwrite the readAny
method:
class MyDecoder extends JsonDecoder {
public readAny(): unknown {
this.skipWhitespace();
const reader = this.reader;
// Try to decode a bigint using the `reader`,
// if it is not a bigint, try to decode all other values:
return super.readAny();
}
}
Awesome :) thank you
I believe it can be closed, will try and revert back if any other pb .
Thank you again !
Hello:
What would be the best course of action if I want to have that part working :
`let _map=new Map(); _map.set('key',{ o:1 })
bn and map are null