MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / frontmatter_string

Function frontmatter_string

atomic-cli/src/commands/vault/context.rs:647–653  ·  view source on GitHub ↗
(frontmatter_json: &str, keys: &[&str])

Source from the content-addressed store, hash-verified

645}
646
647fn frontmatter_string(frontmatter_json: &str, keys: &[&str]) -> Option<String> {
648 let value = serde_json::from_str::<serde_json::Value>(frontmatter_json).ok()?;
649 keys.iter()
650 .find_map(|key| value.get(key).and_then(|item| item.as_str()))
651 .filter(|item| !item.is_empty())
652 .map(String::from)
653}
654
655/// Extract `labels` (array of strings) from frontmatter JSON.
656fn frontmatter_labels(frontmatter_json: &str) -> Vec<String> {

Callers 2

frontmatter_nameFunction · 0.85
frontmatter_memory_idFunction · 0.85

Calls 4

getMethod · 0.65
iterMethod · 0.45
as_strMethod · 0.45
is_emptyMethod · 0.45

Tested by

no test coverage detected