Skip to content

Commit

Permalink
feat(transforms): Add docs for string join transform
Browse files Browse the repository at this point in the history
Signed-off-by: Maximilian Blatt <[email protected]>
  • Loading branch information
MisterMX committed Jan 24, 2024
1 parent 52d3b2d commit 9d88c47
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions content/master/concepts/patch-and-transform.md
Original file line number Diff line number Diff line change
Expand Up @@ -1551,6 +1551,7 @@ String transforms support the following

* [Convert](#string-convert)
* [Format](#string-format)
* [Join](#join)
* [Regexp](#regular-expression-type)
* [TrimPrefix](#trim-prefix)
* [TrimSuffix](#trim-suffix)
Expand Down Expand Up @@ -1597,6 +1598,26 @@ patches:
fmt: "the-field-%s"
```

#### Join

The {{<hover label="typeJoin" line="8">}}type: Join{{</hover>}} joins all
values in the input array into a string using the given separator.

This transform only works with array inputs.

```yaml {label="typeJoin"}
patches:
- type: FromCompositeFieldPath
fromFieldPath: spec.parameters.inputList
toFieldPath: spec.targetJoined
transforms:
- type: string
string:
type: Join
join:
separator: ","
```

#### Regular expression type
The {{<hover label="typeRegex" line="8">}}type: Regexp{{</hover>}} extracts
the part of the input matching a regular expression.
Expand Down

0 comments on commit 9d88c47

Please sign in to comment.