Skip to content

Commit

Permalink
switch to serde-wasm-bindgen (close #13)
Browse files Browse the repository at this point in the history
  • Loading branch information
g-plane committed Nov 30, 2022
1 parent 960fb98 commit 0f26141
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ node = ["napi", "napi-derive", "napi-build"]
chrono = { version = "0.4", features = ["wasmbind"] }
js-sys = "0.3"
serde-wasm-bindgen = "0.4"
wasm-bindgen = { version = "0.2", features = ["serde-serialize"] }
wasm-bindgen = { version = "0.2" }

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
chrono = "0.4"
Expand Down
2 changes: 1 addition & 1 deletion src/wasm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use wasm_bindgen::prelude::*;
#[doc(hidden)]
#[wasm_bindgen]
pub fn browserslist(query: String, opts: JsValue) -> Result<JsValue, JsValue> {
let opts: Option<Opts> = opts.into_serde().unwrap_or_default();
let opts: Option<Opts> = serde_wasm_bindgen::from_value(opts)?;

serde_wasm_bindgen::to_value(
&resolve([query], &opts.unwrap_or_default())
Expand Down

0 comments on commit 0f26141

Please sign in to comment.