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

Feature request - mergeWith #134

Open
JustinMartinDev opened this issue Aug 2, 2023 · 3 comments
Open

Feature request - mergeWith #134

JustinMartinDev opened this issue Aug 2, 2023 · 3 comments
Labels
feature New feature or request

Comments

@JustinMartinDev
Copy link

JustinMartinDev commented Aug 2, 2023

Hello

I would like to know, if you planning to create a mergeWith function allowing to customize the merge function. The perfect use exemple is to merge nested array :

mergeWith(
 { a: [1, 2] }, 
 { a: [3, 4] }, 
 (a, b) => Array.isArray(a) && Array.isArray(b) => [...a, ...b] : undefined
) 
// => { a: [1, 2, 3, 4] } 

lodash doc: https://lodash.com/docs/4.17.15#mergeWith

@Maggi64
Copy link
Owner

Maggi64 commented Aug 6, 2023

Hi, surely a good addition!
We could add this to the merge function, similar to difference where you can append a compare function as the last parameter.
But I don't know when I will find the time to do this. A PR would be appreciated!

@Maggi64 Maggi64 added the feature New feature or request label Oct 6, 2023
@danilrez
Copy link

Hi, any updates?

@Maggi64
Copy link
Owner

Maggi64 commented Feb 29, 2024

I tried for a short while to extend the merge Function, but didn't found a good enough solution that would be fully typesafe. A MR is appreciated, in the next few months I will have the time to look at it again.

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

No branches or pull requests

3 participants