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.18k stars 90 forks source link

Add support for Error.prototype.cause #296

Open shortercode opened 2 months ago

shortercode commented 2 months 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.