Skip to main content

json_to_value

Function json_to_value 

Source
pub fn json_to_value(
    engine: &mut Engine<'_>,
    context: Tracked<'_, Context<'_>>,
    library: &Library,
    json: &Value,
) -> Result<Value, ConvertError>
Expand description

Convert JSON to Typst Value.

  • Objects with “func” field → Content
  • Objects without “func” → Dict
  • Arrays → Array
  • Primitives → corresponding Value variant