style: fix linting issues met ESLint
This commit is contained in:
parent
51a9b58a20
commit
af8c783a26
4 changed files with 13 additions and 13 deletions
|
@ -1,20 +1,20 @@
|
|||
export function deepEquals<T>(a: T, b: T): boolean {
|
||||
if (a === b) return true;
|
||||
if (a === b) {return true;}
|
||||
|
||||
if (typeof a !== 'object' || typeof b !== 'object' || a == null || b == null)
|
||||
return false;
|
||||
{return false;}
|
||||
|
||||
if (Array.isArray(a) !== Array.isArray(b)) return false;
|
||||
if (Array.isArray(a) !== Array.isArray(b)) {return false;}
|
||||
|
||||
if (Array.isArray(a) && Array.isArray(b)) {
|
||||
if (a.length !== b.length) return false;
|
||||
if (a.length !== b.length) {return false;}
|
||||
return a.every((val, i) => deepEquals(val, b[i]));
|
||||
}
|
||||
|
||||
const keysA = Object.keys(a) as (keyof T)[];
|
||||
const keysB = Object.keys(b) as (keyof T)[];
|
||||
|
||||
if (keysA.length !== keysB.length) return false;
|
||||
if (keysA.length !== keysB.length) {return false;}
|
||||
|
||||
return keysA.every(key => deepEquals(a[key], b[key]));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue