Skip to content

feat: return parent paths on edit - #65

Merged
YYsuni merged 1 commit into
YYsuni:mainfrom
ThianHooi:feat/return-parent-paths-on-edit
Dec 19, 2024
Merged

feat: return parent paths on edit#65
YYsuni merged 1 commit into
YYsuni:mainfrom
ThianHooi:feat/return-parent-paths-on-edit

Conversation

@ThianHooi

@ThianHooi ThianHooi commented Dec 17, 2024

Copy link
Copy Markdown
Contributor

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"
    ]
}

@vercel

vercel Bot commented Dec 17, 2024

Copy link
Copy Markdown

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

YYsuni commented Dec 19, 2024

Copy link
Copy Markdown
Owner

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