Closed traut closed 1 week ago
In many use-cases, particularly for simplifying loading JQ queries, it is helpful to join strings.
Implement join() function, similar to Terraform's. The function should accept a separator and a list of strings and returns a string.
join()
For example:
document "test" { vars { items = ["a", "b", "c"] } content text { local_var = query_jq(join("\r", [ from_file("./utils.jq"), ".vars.items | custom_function", ])) value = "Length: {{ .vars.local }}" } }
Background
In many use-cases, particularly for simplifying loading JQ queries, it is helpful to join strings.
Design
Implement
join()
function, similar to Terraform's. The function should accept a separator and a list of strings and returns a string.For example: