-
Notifications
You must be signed in to change notification settings - Fork 40
Open
Description
Currently, if array has duplicates, it generates the diff from start, but maybe it can skip the repeated part. Although, not sure which result is more performant to apply.
Input:
{
"name": "Chris Brown",
"repositories": [
"repo1",
"repo2"
],
"address": {
"street": "Main"
}
}Output:
{
"name": "Christopher Brown",
"repositories": [
"repo1",
"repo2",
"repo3",
"repo1",
"repo2",
"repo3"
]
}Result:
[
{
"op": "replace",
"path": "/name",
"value": "Christopher Brown"
},
{
"op": "add",
"path": "/repositories/0",
"value": "repo1"
},
{
"op": "add",
"path": "/repositories/1",
"value": "repo2"
},
{
"op": "add",
"path": "/repositories/2",
"value": "repo3"
},
{
"op": "add",
"path": "/repositories/-",
"value": "repo3"
}
]Expected result:
[
{
"op": "replace",
"path": "/name",
"value": "Christopher Brown"
},
{
"op": "add",
"path": "/repositories/-",
"value": "repo3"
},
{
"op": "add",
"path": "/repositories/-",
"value": "repo1"
},
{
"op": "add",
"path": "/repositories/-",
"value": "repo2"
},
{
"op": "add",
"path": "/repositories/-",
"value": "repo3"
}
]Metadata
Metadata
Assignees
Labels
No labels