-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JSON.stringify with optional arguments #1186
Comments
Sounds like great APIs to add to me! |
Overall: yes we should totally add support for these optional parameters! Nitpicking: Does the |
Makes sense to me. I assume then |
This commit adds two new externs for `JSON.stringify`: `JSON::stringify_with_replacer` and `JSON::stringify_with_replacer_and_space`. Fixes rustwasm#1186
I created PR #1190 to resolve this issue. Apparently
So all the arguments are |
JSON.stringify
has two optional arguments that are unsupported injs-sys
.js_sys::JSON::stringify
implementation: https://github.com/rustwasm/wasm-bindgen/blob/master/crates/js-sys/src/lib.rs#L3793The two arguments are:
replacer
, is nullable and can be a function or an array ofJsValue
s.space
, is nullable and can be astr
or a number.I imagine two new functions could be exported to support this (untested):
The text was updated successfully, but these errors were encountered: