use wasm_bindgen::JsValue; pub type Result = std::result::Result; /// Helper to replace the `E` to `Error` to `napi::Error` conversion. #[inline] pub fn into_err(error: E) -> JsValue where E: std::fmt::Display, { JsValue::from_str(&error.to_string()) }