Function dilla_renderer::engine::merge
source · pub fn merge(v: Value, v2: Value) -> Result<Value, Error>
Expand description
Merge Map, which are always treated as Attribute
.
{{ { "foo": "bar" }|merge({"wu": "tang"}) }}
-> foo="bar" wu="tang"
{{ { "foo": "bar" }|merge({"foo": "baz"}) }}
-> foo="baz"
{{ { "foo": ["bar", "baz"] }|merge({"foo": ["alpha", "beta"]}) }}
-> foo="alpha beta bar baz"
{{ { "foo": "bar" }|merge({"foo": ["alpha", "beta"]}) }}
-> foo="alpha beta bar"
{{ {"foo": ["alpha", "beta"]}|merge({ "foo": "bar" }) }}
-> foo="bar alpha beta"
{{ { "foo": {"bar": "baz"} }|merge({ "foo": {"wu": "tang"} }) }}
-> foo="wu tang"