mirror of https://github.com/nocodb/nocodb
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
397 B
14 lines
397 B
2 years ago
|
export const deepCompare = (a: any, b: any) => {
|
||
|
if (a === b) return true
|
||
|
if (a == null || b === null) return false
|
||
|
if (typeof a !== typeof b) return false
|
||
|
if (typeof a !== 'object') return a === b
|
||
|
if (Object.keys(a).length !== Object.keys(b).length) return false
|
||
|
|
||
|
for (const k in a) {
|
||
|
if (!(k in b)) return false
|
||
|
if (!deepCompare(a[k], b[k])) return false
|
||
|
}
|
||
|
return true
|
||
|
}
|