(frontmatter_json: &str)
| 690 | } |
| 691 | |
| 692 | fn frontmatter_memory_id(frontmatter_json: &str) -> Option<String> { |
| 693 | let id = frontmatter_string(frontmatter_json, &["@id", "uid", "id"])?; |
| 694 | if id.starts_with("urn:atomic:") { |
| 695 | Some(id) |
| 696 | } else { |
| 697 | Some(format!("urn:atomic:memory:{id}")) |
| 698 | } |
| 699 | } |
| 700 | |
| 701 | fn frontmatter_string(frontmatter_json: &str, keys: &[&str]) -> Option<String> { |
| 702 | let value = serde_json::from_str::<serde_json::Value>(frontmatter_json).ok()?; |
no test coverage detected