Skip to content

Conformance Examples 0.1.0 — Transforms: transform-prepend

prepend-basic

Prepends the argument to the input.

Template

{{ word | prepend: "hello " }}

Context

{
    "word": "world"
}

Output

hello world

prepend-empty-arg

Prepending an empty string leaves the input unchanged.

Template

{{ word | prepend: "" }}

Context

{
    "word": "world"
}

Output

world

prepend-chained-after-upcase

Composes correctly when input arrives from a prior transform.

Template

{{ word | upcase | prepend: "say " }}

Context

{
    "word": "hi"
}

Output

say HI

Source fixture: transforms/transform-prepend.json