Twig icon indicating copy to clipboard operation
Twig copied to clipboard

Feature Request: Add the spread operator

Open sukei opened this issue 4 years ago • 0 comments

Hello, this is more a feature request than an issue. What about adding the spread operator as a replacement/addition to the merge filter? We could improve the readability of the merge operation: { id: 'my_id' }|merge(other_attr) vs { id: 'my_id', ...other_attr }

Many other use cases comes in mind such as: ['first', 'second']|merge(middle)|merge(['last']) vs ['first', 'second', ...middle, 'last'].

I can work on it if approved.

sukei avatar Apr 18 '21 17:04 sukei