zdg #237

Merged
zhengdegang merged 2 commits from zdg into main 2024-09-20 15:17:18 +08:00
1 changed files with 2 additions and 0 deletions

View File

@ -172,6 +172,8 @@ const getObjValue = (obj, key) => {
const findDifferences = (obj1, obj2) => { const findDifferences = (obj1, obj2) => {
const differences = {}; const differences = {};
function compareObjects(o1, o2, path = '') { function compareObjects(o1, o2, path = '') {
if (o1 == null) return
if (o2 == null) return
for (const key in o1) { for (const key in o1) {
if (o1.hasOwnProperty(key)) { if (o1.hasOwnProperty(key)) {
const newPath = path ? `${path}.${key}` : key; const newPath = path ? `${path}.${key}` : key;