-
-
Notifications
You must be signed in to change notification settings - Fork 11
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
mergeAndCompare array more sharply, I can't distinguish between the new and old additions. #34
Comments
@productdevbook I don't see any issues. can you send a screenshot of the error ? |
@productdevbook is it ok for me to ask if you could add a PR that adds this failing test to my test files? It'll be easier for me to look into it this way. |
Have you had time to look at the source code because I'm using your 4 libraries. |
Yes it's just safer if I have the same tests in the source code of this repo. It's also easier for me to debug this way. Would be a great help. I think it's a type issue, I don't deeply merge the nested object types inside of arrays I believe. Will try to take a look this week. |
Can I switch npm to pnpm if you have permission ? I will send a pr for it. and array test pr. |
@productdevbook sadly I use You could just add the test, I also use vitest, no need to do more testing yourself so you might be ok not installing the node modules 😁 |
@productdevbook I was very confused with your tests. You were using that I believe that perhaps you wanted to "merge all objects inside an array"? If that's the case, this was already discussed in #25 it's not a default behaviour of this library, so you have to write the compare fn yourself. That said, I have written a simple version of it for you and added that as a new test on your branch. Can you check out the latest commit in your PR and let me know if this is what you wanted? |
@productdevbook thanks for your reply here Any use case for deeply merging arrays within objects can be achieved with the I will close this issue now but feel free to open a new issue if you hit any reproducible bugs. 🙌🏻 -- |
Thank you back, Why is the content of undefined in the object not the same in the array? After all, there are objects in the array. Shouldn't it be subjected to the same function? I think that it should be the same in the building sequence in the object. |
@productdevbook if you look closely at this line .map((p, i) => (newVal[i] ? merge(p, newVal[i]) : p)) you will see that the compare function uses a nested |
Test error: https://github.com/huntersofbook/huntersofbook/blob/29a836e9690b8c786ea89dddc55240447e016752/packages/schob/test/index.test.ts#L193
Library: https://github.com/huntersofbook/huntersofbook/tree/main/packages/schob
I created a new library using your libraries. But I have a problem with such a test.
Can you help by looking at the codes?
The text was updated successfully, but these errors were encountered: