Skip to content
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

Allow Passing Options to serde_wasm_bindgen #26

Open
cwfitzgerald opened this issue Jul 20, 2023 · 0 comments · May be fixed by #31
Open

Allow Passing Options to serde_wasm_bindgen #26

cwfitzgerald opened this issue Jul 20, 2023 · 0 comments · May be fixed by #31

Comments

@cwfitzgerald
Copy link

serde_wasm_bindgen has various options to change the behavior of the translation between rust and javascript. It would be useful to expose them through attributes on the macro.

Notably:

  • serialize_missing_as_null: Option<T> is T | null instead of T?
  • serialize_maps_as_objects: HashMap<K, V> is Record<K, V> instead of Map<K, V>
  • serialize_large_number_types_as_bigints: {u,i}{64,size} translates to bigint instead of number
  • serialize_bytes_as_arrays: ByteBuf translates to number[] instead of Uint8Array
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant