any →
transform-with(
    operation: expression,
    ...expressions: expression
) → tuple

Transforms the results of one or more expressions with the same open expression and returns them as a tuple.

Parameters

Name Type Required Description
operation expression Yes Open expression evaluated once against each result.
expressions expression Variadic (one or more) One or more expressions evaluated independently against the original input.

Argument evaluation

Evaluates the shared operation against each result produced by the other expression arguments.

  • operation: Evaluated once against each result produced by the other expression arguments, rather than against an element of the incoming value.
  • expressions: Each supplied expression is evaluated once against the value entering this call.

Behavior

transform-with evaluates every variadic expression independently against the original input, then evaluates the shared open expression against each resulting value. Results preserve expression order and are always returned as a tuple, including for a single expression. Unlike apply, the shared expression is evaluated separately for each result rather than once against the input. Unlike collection mapping, the expressions define the values to transform and the input need not be a collection.

Examples

{first-name := " Alice ", last-name := " Smith "} | transform-with(trim, .first-name, .last-name)  T("Alice", "Smith")

Kind: Function
Scope: flow
Aliases: None


This site uses Just the Docs, a documentation theme for Jekyll.