veilid/veilid-core/src/wasm_helpers.rs
2025-02-10 03:06:41 +00:00

22 lines
609 B
Rust

cfg_if::cfg_if! {
if #[cfg(all(target_arch = "wasm32", target_os = "unknown"))] {
pub use tsify::*;
pub use wasm_bindgen::prelude::*;
macro_rules! from_impl_to_jsvalue {
($name: ident) => {
impl From<$name> for JsValue {
fn from(value: $name) -> Self {
serde_wasm_bindgen::to_value(&value).unwrap()
}
}
}
}
} else {
macro_rules! from_impl_to_jsvalue {
($name: ident) => {}
}
}
}
pub(crate) use from_impl_to_jsvalue;