benthosdev / benthos

Fancy stream processing made operationally mundane
https://www.benthos.dev
MIT License
7.68k stars 752 forks source link

Add "array" bloblang method #2538

Open gramian opened 3 weeks ago

gramian commented 3 weeks ago

These changes add an array type coercion bloblang method similar to the bytes method: If the caller is already of type array the the input is returned. If it is any other type the input is wrapped into a one-element array. Such a method helps to avoid constructs like this.with("name").values().flatten() to ensure an array returned.

Feedback welcome