Uses superjson to serialize expressions while retaining the original object type.
Accepts the following values, including arrays and objects:
stringnumberbooleanDatebigintMapSetArrayBufferInt8ArrayInt16ArrayInt32ArrayUint8ArrayUint16ArrayUint32ArrayUint8ClampedArrayRegExpErrorURLundefinednull
npm install superjson-codecimport { stringify, parse } from "superjson-codec";
const encoded = stringify({
key: "value",
});
const decoded = parse(encoded);