Currently supported operations are
- String interpolation
- Scope injection using
<
- String filtering using
|
- Fallback from undefined using
??
Although combinations of above operations can structure many of the configuration, there is some limitations to achieve everything. This issue is a small proposal for future improvements of operations
List Operation
Merging two lists
{
"plus": "{{ first + second }}",
"colons": "{{ first::second }}",
"array_unpack": ["*{{ first }}", "*{{ second }}" ]
}
Mapping injection with list of scope (really required?)
{
"scopes": [
{ "name": "foo" },
{ "name": "bar" },
{ "name": "cor" },
{ "name": "giz" }
]
}
{
"greeting": "hello, {{ name }}",
"greetings": "{{ greeting << scopes }}",
"greetings2": [
"{% for scope in scopes %}",
"{{ greeting < scope }}",
"{% end for %}"
]
}
Unique filter
{
"duplicated": [1, 1, 2, 3, 3, 3],
"unqiue" : "{{ duplicated | unique }}"
}
Dictionary
Merging two dictionary (really required?)
{
"plus": "{{ first + second }}",
"unpack": [
"**{{ this_is_weird }}",
"**{{ looks_like_an_array }}"
]
}
Integer Operation
Simple integer operation
{
"one": 1,
"two": "{{ one + 1 }}",
"three": "{{ one * 3 }}",
"four": "{{ two * two }}",
"five": "{{ 10 / two }}"
}
Currently supported operations are
<|??Although combinations of above operations can structure many of the configuration, there is some limitations to achieve everything. This issue is a small proposal for future improvements of operations
List Operation
Merging two lists
{ "plus": "{{ first + second }}", "colons": "{{ first::second }}", "array_unpack": ["*{{ first }}", "*{{ second }}" ] }Mapping injection with list of scope (really required?)
{ "scopes": [ { "name": "foo" }, { "name": "bar" }, { "name": "cor" }, { "name": "giz" } ] } { "greeting": "hello, {{ name }}", "greetings": "{{ greeting << scopes }}", "greetings2": [ "{% for scope in scopes %}", "{{ greeting < scope }}", "{% end for %}" ] }Unique filter
{ "duplicated": [1, 1, 2, 3, 3, 3], "unqiue" : "{{ duplicated | unique }}" }Dictionary
Merging two dictionary (really required?)
{ "plus": "{{ first + second }}", "unpack": [ "**{{ this_is_weird }}", "**{{ looks_like_an_array }}" ] }Integer Operation
Simple integer operation
{ "one": 1, "two": "{{ one + 1 }}", "three": "{{ one * 3 }}", "four": "{{ two * two }}", "five": "{{ 10 / two }}" }