mirror of
https://github.com/loro-dev/loro.git
synced 2025-02-08 21:47:41 +00:00
feat(wasm): get deep value
This commit is contained in:
parent
7b855c88da
commit
66d74c1e74
1 changed files with 7 additions and 1 deletions
|
@ -552,6 +552,12 @@ impl Loro {
|
||||||
let f = self.0.oplog().lock().unwrap().dag().vv_to_frontiers(&vv);
|
let f = self.0.oplog().lock().unwrap().dag().vv_to_frontiers(&vv);
|
||||||
Ok(frontiers_to_ids(&f))
|
Ok(frontiers_to_ids(&f))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[wasm_bindgen(js_name = "getDeepValue")]
|
||||||
|
pub fn get_deep_value(&self) -> JsValue {
|
||||||
|
let value = self.0.get_deep_value();
|
||||||
|
JsValue::from(value)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn js_map_to_vv(map: js_sys::Map) -> JsResult<VersionVector> {
|
fn js_map_to_vv(map: js_sys::Map) -> JsResult<VersionVector> {
|
||||||
|
@ -852,7 +858,7 @@ impl LoroMap {
|
||||||
self.0.get_deep_value().into()
|
self.0.get_deep_value().into()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[wasm_bindgen(js_name = "insertContainer")]
|
#[wasm_bindgen(js_name = "setContainer")]
|
||||||
pub fn insert_container(&mut self, key: &str, container_type: &str) -> JsResult<JsValue> {
|
pub fn insert_container(&mut self, key: &str, container_type: &str) -> JsResult<JsValue> {
|
||||||
let type_ = match container_type {
|
let type_ = match container_type {
|
||||||
"text" | "Text" => ContainerType::Text,
|
"text" | "Text" => ContainerType::Text,
|
||||||
|
|
Loading…
Reference in a new issue