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

Any plans for TypedArray? #285

Closed aryzing closed 8 months ago

aryzing commented 8 months ago

Any plans on supporting TypedArray? Would be great for apps which need raw data, especially common in IoT and crypto.

Skn0tt commented 8 months ago

Hi @aryzing! SuperJSON already has support for typed arrays. Here's the unit test for it: https://github.com/blitz-js/superjson/blob/0130a809f87df142b5e190e1b519be0c0280fb16/src/index.test.ts#L611-L626

Maybe we should add it to the README!

aryzing commented 8 months ago

Great! Didn't dig into the code and opened the issue based on the README, which didn't mention typed arrays. Thanks for letting me know :)