Function dilla_renderer::renderable::add_attr_to_json_component
source · pub fn add_attr_to_json_component(
v: &Value,
name: String,
value: Option<Value>
) -> ValueExpand description
Adds an attribute to a JSON component.
Arguments
v- A reference to aminijinja::Valuethat represents the JSON component to which the attribute should be added.name- AStringthat represents the name of the attribute to be added.value- AnOption<minijinja::Value>that represents the value of the attribute to be added. IfNone, an empty string is used as the value.
Returns
minijinja::Value- The updated JSON component with the added attribute.