Skip to main content

value_as_string

Function value_as_string 

Source
pub fn value_as_string(value: &Value) -> Option<String>
Expand description

Extract a frontmatter value as a string, handling the case where YAML parsed a hex-like string (e.g., 753659e7) as a number.

Returns Some(string) if the value is a String or a Number that can be converted to string. Returns None for other types.