thoughtbot / fishery

A library for setting up JavaScript objects as test data
MIT License
876 stars 36 forks source link

Fix merging of `Buffer` objects #100

Open sds opened 2 years ago

sds commented 2 years ago

Previously, if you attempted to build/create an object whose properties contained Buffers, they would be converted from the native Buffer type into an array (and thus creating an incorrect value). This is caused by the use of lodash's merge implementation (see https://github.com/lodash/lodash/issues/2964).

The recommended solution from the lodash project is to define a merge customizer to specifically handle this situation, which is what we do here.

pfletcherhill commented 1 year ago

Having the same problem with Uint8Array. Can we include that too and get this merged?