(a: T[], b: T[], identityAccessor?: (value: T) => unknown)
| 17 | * the array. |
| 18 | */ |
| 19 | export function arrayEquals<T>(a: T[], b: T[], identityAccessor?: (value: T) => unknown): boolean { |
| 20 | if (a.length !== b.length) return false; |
| 21 | for (let i = 0; i < a.length; i++) { |
| 22 | let valueA = a[i]; |
| 23 | let valueB = b[i]; |
| 24 | if (identityAccessor) { |
| 25 | valueA = identityAccessor(valueA) as any; |
| 26 | valueB = identityAccessor(valueB) as any; |
| 27 | } |
| 28 | if (valueB !== valueA) { |
| 29 | return false; |
| 30 | } |
| 31 | } |
| 32 | return true; |
| 33 | } |
| 34 | |
| 35 | /** |
| 36 | * Flattens an array. |
no outgoing calls
no test coverage detected
searching dependent graphs…