Skip to content

Conformance Examples 0.1.0 — Transforms: transform-concat

concat-numbers

The argument list's elements are appended to the input list's elements.

Template

{{ a | concat: b }}

Context

{
    "a": [
        1,
        2
    ],
    "b": [
        3,
        4
    ]
}

Output

[1,2,3,4]

concat-strings

Concatenation preserves order across both lists.

Template

{{ a | concat: b }}

Context

{
    "a": [
        "x"
    ],
    "b": [
        "y",
        "z"
    ]
}

Output

["x","y","z"]

concat-input-non-list-is-null

A non-list input does not match the transform's shape, so the result is null.

Template

{{ a | concat: b }}

Context

{
    "a": "hi",
    "b": [
        1
    ]
}

Output

null

concat-arg-non-list-is-null

A non-list argument is a soft failure, so concat yields null.

Template

{{ a | concat: b }}

Context

{
    "a": [
        1
    ],
    "b": "x"
}

Output

null

Source fixture: transforms/transform-concat.json