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

lodash/fp extends doesn't work with multiple sources #4040

Closed
misha-erm opened this issue Nov 3, 2018 · 4 comments
Closed

lodash/fp extends doesn't work with multiple sources #4040

misha-erm opened this issue Nov 3, 2018 · 4 comments
Labels

Comments

@misha-erm
Copy link

misha-erm commented Nov 3, 2018

Looks like _.assignIn doesn't work as it's documented.

When I try to pass multiple sources like _.extend({a:1}, [{c:3}, {a: 2, c:1}]) the output is

{
  "0": { "c": 3 },
  "1": { "a": 2, "c": 1 },
  "a": 1
}

but should be

{
  a: 2,
  c: 1
}

Looks like a bug for me. Probably the same issue is happening with some other similar functions like _.defaults, _.merge

Tested in http://dexters-lab.io/ with lodash versions 4.17.4 and with 4.17.11

Thanks in advance

@jdalton
Copy link
Member

jdalton commented Nov 3, 2018

Hi @MikeYermolayev!

I think you're looking for _.assignInAll.

@jdalton jdalton closed this as completed Nov 3, 2018
@misha-erm
Copy link
Author

@jdalton thanks for you answer but docs https://gist.github.com/jfmengels/6b973b69c491375117dc#_assigninobject-sources look incorrect then. Shouldn’t it be corrected? Or it’s not the source of truth?

@jdalton
Copy link
Member

jdalton commented Nov 3, 2018

That gist is incorrect. Check out our FP Guide.

@lock
Copy link

lock bot commented Nov 3, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Nov 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests

2 participants