Closed mikaelkaron closed 1 year ago
Good catch. But the thing is, that we should add an option how buffers should be merged.
I mean, you could actually provide a custom array merger function which checks for buffer and returns a ref or a new Buffer. But actually not merging buffers but replacing buffers makes more sense.
All for that. One could also be allowed to provide isMergeableObject
and similar functions as arguments to deepmerge
to control this on a case by case basis.
Adding an option for a custom isMergeableObject should be small patch.
But still, you are right regarding the Buffer. Buffer is a builtIn, so I would assume that we should take special care of it.
Prerequisites
Fastify version
4
Plugin version
1.1.0
Node.js version
16.17.0
Operating system
Linux
Operating system version (i.e. 20.04, 11.3, 10)
20.04
Description
Since
Buffer
is in essence just aUint8Array
it gets mangled by deepmerge.Steps to Reproduce
Expected Behavior