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

Any plans for TypedArray? #285

Closed aryzing closed 4 months ago

aryzing commented 4 months ago

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

Skn0tt commented 4 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 4 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 :)