2018-05-12 18:39:29 +02:00
|
|
|
---
|
2021-12-15 03:41:17 +01:00
|
|
|
page_title: transpose - Functions - Configuration Language
|
2018-05-12 18:39:29 +02:00
|
|
|
description: |-
|
|
|
|
The transpose function takes a map of lists of strings and swaps the keys
|
|
|
|
and values.
|
|
|
|
---
|
|
|
|
|
|
|
|
# `transpose` Function
|
|
|
|
|
|
|
|
`transpose` takes a map of lists of strings and swaps the keys and values
|
|
|
|
to produce a new map of lists of strings.
|
|
|
|
|
|
|
|
## Examples
|
|
|
|
|
|
|
|
```
|
|
|
|
> transpose({"a" = ["1", "2"], "b" = ["2", "3"]})
|
|
|
|
{
|
|
|
|
"1" = [
|
|
|
|
"a",
|
|
|
|
],
|
|
|
|
"2" = [
|
|
|
|
"a",
|
|
|
|
"b",
|
|
|
|
],
|
|
|
|
"3" = [
|
|
|
|
"b",
|
|
|
|
],
|
|
|
|
}
|
|
|
|
```
|