Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix merging of Buffer objects #100

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Fix merging of Buffer objects #100

wants to merge 4 commits into from

Conversation

sds
Copy link

@sds sds commented Apr 30, 2022

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 lodash/lodash#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.

Previously, if you attempted to `build`/`create` an object whose properties contained `Buffer`s, 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 lodash/lodash#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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants