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
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>
isT | null
instead ofT?
serialize_maps_as_objects
: HashMap<K, V> isRecord<K, V>
instead ofMap<K, V>
serialize_large_number_types_as_bigints
:{u,i}{64,size}
translates tobigint
instead ofnumber
serialize_bytes_as_arrays
:ByteBuf
translates tonumber[]
instead ofUint8Array