Open hoegge opened 8 months ago
While not documented, it was a conscious choice not to clone the incoming buffer before applying the swap (for speed reasons - the buffer might be VERY large).
It may be worth adding a "[ ] clone" option instead to make it clearer? (How many people actually read the help?)
Will think it over.
PS, pull requests would be happily accepted.
Understand, and I read up a bit on the passing by reference usage in Node-RED. Seems like most modules by standard clones the output, but if several nodes use same output they get the same reference. And makes a lot of sense to pass buffers as reference. I'll try to see if I can make a contribution, where this is an option, although I'm no Node-RED developer (yet)
PS: I read documentation, especially since it is otherwise hard to know how modules work. In general Node-RED packages are not super well documented, but your buffer packages has great docs.
It would be helpful to user to know, that this modifes the source buffer, when swapping, since the buffer might be sent to other nodes too, or shown in status node.