MCPcopy Create free account
hub / github.com/douglance/devsql / find_in_json

Method find_in_json

crates/ccql/src/search/mod.rs:37–47  ·  view source on GitHub ↗
(&self, value: &serde_json::Value)

Source from the content-addressed store, hash-verified

35 }
36
37 pub fn find_in_json(&self, value: &serde_json::Value) -> bool {
38 match value {
39 serde_json::Value::String(s) => self.matches(s),
40 serde_json::Value::Array(arr) => arr.iter().any(|v| self.find_in_json(v)),
41 serde_json::Value::Object(obj) => obj.values().any(|v| self.find_in_json(v)),
42 _ => {
43 let s = value.to_string();
44 self.matches(&s)
45 }
46 }
47 }
48
49 pub fn highlight(&self, text: &str) -> String {
50 use colored::Colorize;

Callers 1

searchFunction · 0.80

Calls 1

matchesMethod · 0.80

Tested by

no test coverage detected