Skip to content

Conformance Examples 0.1.0 — Transforms: transform-append

append-string-literal

Append a string literal to a string value via {{ greeting | append: "!" }}.

Template

{{ greeting | append: "!" }}

Context

{
    "greeting": "hello"
}

Output

hello!

append-identifier-arg

Append a value from the context via {{ greeting | append: suffix }}.

Template

{{ greeting | append: suffix }}

Context

{
    "greeting": "hello",
    "suffix": "!"
}

Output

hello!

append-numeric-arg-coerced

Append a numeric argument coerced to string via {{ value | append: 42 }}.

Template

{{ value | append: 42 }}

Context

{
    "value": "x"
}

Output

x42

append-null-arg

Append a null argument (renders as "null" string) via {{ value | append: null }}.

Template

{{ value | append: null }}

Context

{
    "value": "x"
}

Output

xnull

append-chained-after-upcase

Chaining append after upcase: {{ greeting | upcase | append: "!" }}.

Template

{{ greeting | upcase | append: "!" }}

Context

{
    "greeting": "hello"
}

Output

HELLO!

append-chained-before-upcase

Chaining append before upcase: {{ greeting | append: "!" | upcase }}.

Template

{{ greeting | append: "!" | upcase }}

Context

{
    "greeting": "hello"
}

Output

HELLO!

Source fixture: transforms/transform-append.json