(left: T[], right: T[])
| 5 | * Check whether two arrays contains the same items. * |
| 6 | */ |
| 7 | export function arrayEquals<T>(left: T[], right: T[]): boolean { |
| 8 | const length = left.length; |
| 9 | if (length !== right.length) { |
| 10 | return false; |
| 11 | } |
| 12 | |
| 13 | for (let i = 0; i < length; i++) { |
| 14 | if (left[i] !== right[i]) { |
| 15 | return false; |
| 16 | } |
| 17 | } |
| 18 | |
| 19 | return true; |
| 20 | } |
| 21 | |
| 22 | /** |
| 23 | * Like Array.map() but lazy. It will allocate a new array |
no outgoing calls
no test coverage detected