ReduceObject: {
    @reduce: (PipeItem[] | PipeObject | ReduceObject)[];
}

Reduce is similar to Pipe in that it represents a new context and may include an array of PipeItem[], PipeObject, or ReduceObject. But it also iterates and produces output. The context variables, $input, $output, $item, $key, and $index are available.

// Example of a reduce expression. The optional object is empty and
// serves as the $output during iteration. The last step in the iteration
// sets $output. if ther are no more iterations, the $output is returned
// and provided to the next step in the pipeline.

// If data is:
// { response: ['a', 'b', 'c'] }

// The reduced/transformed expression will be:
// { 'a': 0, 'b': 1, 'c': 2 }

// Arrays and objects may be iterated over and transformed.

//YAML
'@pipe':
- ['{data.response}', {}]
- '@reduce':
- '@pipe':
- ['{$output}']
- '@pipe':
- ['{$item}']
- '@pipe':
- ['{$index}']
- ['{@object.set}']