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

feat: return parent paths on edit #65

Merged
merged 1 commit into from
Dec 19, 2024

Conversation

ThianHooi
Copy link
Contributor

@ThianHooi ThianHooi commented Dec 17, 2024

This PR added an implementation of returning a variable of parentPath in the functions of onEdit, OnDelete, onAdd and OnChange. This will allow us to correctly indicate which field in the JSON is being edited

Example

image

When obj.nested.k4 is edited, the onEdit will return params as such

{
    "newValue": "lorem",
    "oldValue": "nested",
    "depth": 3,
    "src": {...},
    "indexOrName": "k4",
    "parentType": "object",
    "parentPath": [
        "obj",
        "nested"
    ]
}

Copy link

vercel bot commented Dec 17, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
json-view ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 17, 2024 0:57am
react18-json-view ❌ Failed (Inspect) Dec 17, 2024 0:57am

@YYsuni
Copy link
Owner

YYsuni commented Dec 19, 2024

0.2.9-canary.9 here.

@ThianHooi ThianHooi deleted the feat/return-parent-paths-on-edit branch December 19, 2024 05:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants