We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3eaa089 commit 639104eCopy full SHA for 639104e
frontends/web/src/utils/equal.ts
@@ -1,5 +1,6 @@
1
/**
2
* Copyright 2018 Shift Devices AG
3
+ * Copyright 2025 Shift Crypto AG
4
*
5
* Licensed under the Apache License, Version 2.0 (the "License");
6
* you may not use this file except in compliance with the License.
@@ -61,7 +62,12 @@ export const equal = (a: unknown, b: unknown): boolean => {
61
62
return false;
63
}
64
for (let i = 0; i < a.length; i++) {
- if (!equal(a[i], b[i])) {
65
+ // handle sparse arrays
66
+ const hasA = i in a;
67
+ if (hasA !== i in b) {
68
+ return false;
69
+ }
70
+ if (hasA && !equal(a[i], b[i])) {
71
72
73
0 commit comments