fix build of nodejs sdk

pull/19/head
Niko PLP 6 months ago
parent 9af14b47c0
commit 4048efd714
  1. 21
      ng-sdk-js/src/lib.rs

@ -366,13 +366,7 @@ extern "C" {
#[cfg(wasmpack_target = "nodejs")] #[cfg(wasmpack_target = "nodejs")]
#[wasm_bindgen] #[wasm_bindgen]
pub fn client_info() -> JsValue { pub fn client_info() -> JsValue {
let res = ClientInfo::V0(ClientInfoV0 { let res = ClientInfo::V0(client_info_());
client_type: ClientType::NodeService,
details: client_details(),
version: version(),
timestamp_install: 0,
timestamp_updated: 0,
});
//res //res
serde_wasm_bindgen::to_value(&res).unwrap() serde_wasm_bindgen::to_value(&res).unwrap()
} }
@ -428,6 +422,19 @@ pub fn client_info_() -> ClientInfoV0 {
//serde_wasm_bindgen::to_value(&res).unwrap() //serde_wasm_bindgen::to_value(&res).unwrap()
} }
#[cfg(all(wasmpack_target = "nodejs", target_arch = "wasm32"))]
pub fn client_info_() -> ClientInfoV0 {
let res = ClientInfoV0 {
client_type: ClientType::NodeService,
details: client_details(),
version: version(),
timestamp_install: 0,
timestamp_updated: 0,
};
res
//serde_wasm_bindgen::to_value(&res).unwrap()
}
#[cfg(all(not(wasmpack_target = "nodejs"), target_arch = "wasm32"))] #[cfg(all(not(wasmpack_target = "nodejs"), target_arch = "wasm32"))]
#[wasm_bindgen] #[wasm_bindgen]
pub fn client_info() -> JsValue { pub fn client_info() -> JsValue {

Loading…
Cancel
Save