Twig
Twig copied to clipboard
Feature Request: Add the spread operator
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.