Skip to content

Conversation

@andersk
Copy link
Contributor

@andersk andersk commented Jul 6, 2021

lodash.merge has the following undesired behavior on arrays:

> chunks = { main: ['a', 'b', 'c', 'd', 'e'] } { main: [ 'a', 'b', 'c', 'd', 'e' ] } > merge(chunks, { main: ['foo', 'bar'] }) { main: [ 'foo', 'bar', 'c', 'd', 'e' ] }

Instead of using lodash.merge (#98), specify exactly which objects need to be combined using lodash.assign.

Cc @TomekStaszkiewicz @joaopslins

andersk added a commit to andersk/zulip that referenced this pull request Jul 6, 2021
timabbott pushed a commit to zulip/zulip that referenced this pull request Jul 6, 2021
@fjsj
Copy link
Member

fjsj commented Jul 7, 2021

Thanks @andersk .
Any easy regression test we can add here to prevent such wrong behavior again?

@andersk
Copy link
Contributor Author

andersk commented Jul 7, 2021

Added tests and fixed the TypeScript typings.

(Why aren’t the CircleCI tests running on pull requests?)

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
lodash.merge has the following undesired behavior on arrays: > chunks = { main: ['a', 'b', 'c', 'd', 'e'] } { main: [ 'a', 'b', 'c', 'd', 'e' ] } > merge(chunks, { main: ['foo', 'bar'] }) { main: [ 'foo', 'bar', 'c', 'd', 'e' ] } Instead of using lodash.merge, specify exactly which objects need to be combined using lodash.assign. Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Copy link
Member

@fjsj fjsj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, merging, thank you very much.

@fjsj fjsj merged commit 509ac0d into django-webpack:master Jul 14, 2021
@fjsj
Copy link
Member

fjsj commented Jul 14, 2021

Released at 1.2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants