-
Notifications
You must be signed in to change notification settings - Fork 230
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(wallet-ui): connect to keplr with smart wallet (#5744)
* feat(wallet-ui): connect to keplr with smart wallet * fix: more robust equality check
- Loading branch information
1 parent
abd0946
commit 3482e0d
Showing
5 changed files
with
83 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
export const deepEquals = (a, b) => { | ||
if (a === b) { | ||
return true; | ||
} | ||
if (a instanceof Date && b instanceof Date) { | ||
return a.getTime() === b.getTime(); | ||
} | ||
if (!a || !b || (typeof a !== 'object' && typeof b !== 'object')) { | ||
return a === b; | ||
} | ||
if (a === null || a === undefined || b === null || b === undefined) { | ||
return false; | ||
} | ||
if (a.prototype !== b.prototype) { | ||
return false; | ||
} | ||
const keys = Object.keys(a); | ||
if (keys.length !== Object.keys(b).length) { | ||
return false; | ||
} | ||
return keys.every(k => deepEquals(a[k], b[k])); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters