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

I get undefined error in diffApply #477

Open
alirezahmz opened this issue Jul 30, 2022 · 2 comments
Open

I get undefined error in diffApply #477

alirezahmz opened this issue Jul 30, 2022 · 2 comments
Labels

Comments

@alirezahmz
Copy link

When I delete an item, it returns undefined and when I use diffApply with undefined value, I get the following error.
diffApply

@alirezahmz alirezahmz changed the title get undefined error in diffApply I get undefined error in diffApply Jul 30, 2022
@angus-c
Copy link
Owner

angus-c commented Jul 31, 2022

Can you give an example of you are trying to do?
I don't think we should support diffApply(undefined, diff).

@47vigen
Copy link

47vigen commented Aug 7, 2022

Can you give an example of you are trying to do? I don't think we should support diffApply(undefined, diff).

I don't think the issue @alirezahmz said was in the sense you said, I have encountered this problem several times in nested objects.
We use this package as a transaction in a project, and in this case, we often encounter the "undefined" problem.

example:

const obj = { items: [{...}, { props : { marks:  undefined } }] }
diffApply(obj, { op: "add", path: ["items", 0, "props", "marks", 0], value: "text" })

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

No branches or pull requests

3 participants