flightcontrolhq / superjson

Safely serialize JavaScript expressions to a superset of JSON, which includes Dates, BigInts, and more.
https://www.flightcontrol.dev?ref=superjson
MIT License
4.13k stars 91 forks source link

Add support for Error.prototype.cause #296

Open shortercode opened 1 month ago

shortercode commented 1 month ago

Relates to #294

Modifies the isDeep call to match Error objects, so that causes are correctly serialised. Adds the cause field to serialised Error format and the deserialiser.