MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / navigate_json

Function navigate_json

nodedb/src/engine/document/store/extract.rs:44–53  ·  view source on GitHub ↗
(value: &'a serde_json::Value, path: &str)

Source from the content-addressed store, hash-verified

42}
43
44fn navigate_json<'a>(value: &'a serde_json::Value, path: &str) -> Option<&'a serde_json::Value> {
45 if path.is_empty() {
46 return Some(value);
47 }
48 let mut current = value;
49 for segment in path.split('.') {
50 current = current.get(segment)?;
51 }
52 Some(current)
53}
54
55fn navigate_rmpv<'a>(value: &'a rmpv::Value, path: &str) -> Option<&'a rmpv::Value> {
56 if path.is_empty() {

Callers 1

extract_index_valuesFunction · 0.85

Calls 2

is_emptyMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected