Function minijinja::functions::dict

source ·
pub fn dict(value: Value) -> Result<Value, Error>
Available on crate feature builtins only.
Expand description

Creates a dictionary.

This is a convenient alternative for a dictionary literal. {"foo": "bar"} is the same as dict(foo="bar").

<script>const CONFIG = {{ dict(
  DEBUG=true,
  API_URL_PREFIX="/api"
)|tojson }};</script>