blitz-js / superjson

Safely serialize JavaScript expressions to a superset of JSON, which includes Dates, BigInts, and more.
MIT License
3.88k stars 83 forks source link

Export SuperJSONResult type #271

Closed tmcw closed 8 months ago

tmcw commented 8 months ago

We were previously using SuperJSON v1, and importing from dist/types to get the SuperJSONResult type. Now that it's at v2 and there's an explicit exports entry in superjson, we can't do that, and it'd be nicer if index.ts re-exported SuperJSONResult to make that access possible.

This is for things like making sure that a zod parser that tests whether a value is "like" a SuperJSONResult is accurate, or just for typing the output of functions that return SuperJSON-serialized data.

Skn0tt commented 8 months ago

That's a good idea! Do you wanna open another PR for this?

tmcw commented 8 months ago

Sure! PR: https://github.com/blitz-js/superjson/pull/272