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

Function frontmatter_labels

libatomic/src/daemon/services_agent.rs:289–300  ·  view source on GitHub ↗

Extract `labels` (array of strings) from frontmatter JSON.

(frontmatter_json: &str)

Source from the content-addressed store, hash-verified

287
288 /// Extract `labels` (array of strings) from frontmatter JSON.
289 fn frontmatter_labels(frontmatter_json: &str) -> Vec<String> {
290 serde_json::from_str::<serde_json::Value>(frontmatter_json)
291 .ok()
292 .and_then(|v| {
293 v.get("labels").and_then(|l| l.as_array()).map(|arr| {
294 arr.iter()
295 .filter_map(|x| x.as_str().map(String::from))
296 .collect()
297 })
298 })
299 .unwrap_or_default()
300 }
301
302 fn is_eligible_memory(entry: &VaultEntry) -> bool {
303 if entry.entry_type != VaultEntryType::Memory {

Callers 1

seed_from_intentFunction · 0.70

Calls 5

getMethod · 0.65
okMethod · 0.45
collectMethod · 0.45
iterMethod · 0.45
as_strMethod · 0.45

Tested by

no test coverage detected