DenoDDeno
Powered by
zheilbronZ
Deno•3y ago•
2 replies
zheilbron

serde_v8::from_v8 for BigInts unsupported through `deserialize_any`

Deserializing BigInts is currently not supported unless a specific type is requested (e.g. it's unsupported through
deserialize_any
deserialize_any
path: https://github.com/denoland/deno_core/blob/main/serde_v8/de.rs#L131). This means that, for example, an object containing a field with a BigInt value cannot be deserialized. I assume this is because it's unclear which rust type to map it to?

If so, are there any issues with the following mapping rules?
- If the BigInt < 0 and within
i64
i64
bounds, then deserialize as
i64
i64

- If the BigInt >= 0 and within
u64
u64
bounds, then deserialize as
u64
u64

- Otherwise throw an error
GitHub
deno_core/serde_v8/de.rs at main · denoland/deno_core
The core engine at the heart of Deno. Contribute to denoland/deno_core development by creating an account on GitHub.
deno_core/serde_v8/de.rs at main · denoland/deno_core
Deno banner
DenoJoin
Chat about Deno, a modern runtime for JavaScript and TypeScript.
20,934Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

How to extend `serde_v8` to handle custom logic?
Kalleby SantosKKalleby Santos / help
14mo ago
rusty_v8 - how to pass data from js/v8 into rust
WereiiWWereii / help
3y ago
Userland V8 snapshots
jgouxJjgoux / help
2y ago