MCPcopy Index your code
hub / github.com/NativeScript/SimDeck / string_value

Function string_value

packages/server/src/devtools.rs:1988–1995  ·  view source on GitHub ↗
(object: &Value, key: &str)

Source from the content-addressed store, hash-verified

1986}
1987
1988fn string_value(object: &Value, key: &str) -> Option<String> {
1989 object
1990 .get(key)
1991 .and_then(Value::as_str)
1992 .map(str::trim)
1993 .filter(|value| !value.is_empty())
1994 .map(ToOwned::to_owned)
1995}
1996
1997fn nested_string_value(object: &Value, key_path: &str) -> Option<String> {
1998 let mut current = object;

Calls 2

is_emptyMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected