Closed HIngelhag closed 1 year ago
Hi @HIngelhag. You can directly use the record in this case:
console.log(result); // {id: "123456789"}
console.log(JSON.stringify(result)); "{\"id\":\"123456789\"}"
This works because "optional" unions can always be unwrapped. Depending on your union's included types, the above record might also need to use a wrapped representation.
Finally, toString
returns the record's JSON-encoded representation, which always includes type information. You can set the omitRecordMethods
option to true
when creating the type if you'd prefer to omit the method.
I wanna remove the type information from the resulting JSON I get when using
fromBuffer
.My implementation look like this:
What I get is this:
.. but I want it to look like this:
Is that feasible without writing my own parser?