-
Notifications
You must be signed in to change notification settings - Fork 494
Open
Description
json1
{
"statisticsOption": [
{
"key": "date",
"prop": "date",
"name": "日期",
"show": true,
"description": "日期"
},
{
"key": "failedSubscriptionUser",
"prop": "failedSubscriptionUser",
"name": "当日失败订阅用户数",
"show": true,
"description": "不重复的用户数"
},
{
"key": "successSubscription",
"prop": "successSubscription",
"name": "当日成功订阅",
"show": true,
"description": "不含退款"
}
]
}json2
{
"statisticsOption": [
{
"key": "date",
"prop": "date",
"name": "日期1",
"show": true,
"description": "日期1"
},
{
"key": "failedSubscriptionUser",
"prop": "failedSubscriptionUser",
"name": "当日失败订阅用1户数",
"show": true,
"description": "不重复的1用户数"
},
{
"key": "successSubscription",
"prop": "successSubscription",
"name": "当日成功1订阅",
"show": true,
"description": "不含1退款"
}
]
}Each object in the array has a unique value: key
let diffpatcher = jsondiffpatch.create({
objectHash: (obj) => {
return obj.key
}
})
console.log(diffpatcher .diff(json1, json2))I want to return the only key value followed.
However, the key value has not actually been modified.
My data can not be changed to an object.
What should I do?
Metadata
Metadata
Assignees
Labels
No labels