Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Larkooo committed Nov 5, 2024
1 parent 8090ae0 commit f015fbe
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/wasm/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,16 @@ pub fn parse_ty_as_json_str(ty: &dojo_types::schema::Ty, key: bool) -> Ty {
(child.name.to_owned(), parse_ty_as_json_str(&child.ty, child.key))
})
.collect::<HashMap<String, Ty>>();

// Convert to JsValue as an object instead of a Map
let js_obj = js_sys::Object::new();
for (key, value) in map {
js_sys::Reflect::set(
&js_obj,
&JsValue::from_str(&key),
&serde_wasm_bindgen::to_value(&value).unwrap()
).unwrap();
&serde_wasm_bindgen::to_value(&value).unwrap(),
)
.unwrap();
}
JsValue::from(js_obj)
},
Expand Down

0 comments on commit f015fbe

Please sign in to comment.