repo.or.cz
/
ProtonMail-WebClient.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Cleanup - unused files / unused exports / duplicate exports
[ProtonMail-WebClient.git]
/
packages
/
utils
/
shallowEqual.ts
blob
c591acab160dd86ded9021fcbf2ef6830fea3c45
1
/**
2
* Determine if two arrays are shallowy equal (i.e. they have the same length and the same elements)
3
*/
4
export default function shallowEqual<T>(a: T[], b: T[]) {
5
if (a.length !== b.length) {
6
return false;
7
}
8
for (let i = 0; i < a.length; i++) {
9
if (a[i] !== b[i]) {
10
return false;
11
}
12
}
13
return true;
14
}