( base: T[], other: T[], equivalentPredicate: (baseElement: T, otherElement: T) => boolean, )
| 166 | } |
| 167 | |
| 168 | function areAllEquivalentPredicate<T>( |
| 169 | base: T[], |
| 170 | other: T[], |
| 171 | equivalentPredicate: (baseElement: T, otherElement: T) => boolean, |
| 172 | ) { |
| 173 | const len = base.length; |
| 174 | if (len !== other.length) { |
| 175 | return false; |
| 176 | } |
| 177 | for (let i = 0; i < len; i++) { |
| 178 | if (!equivalentPredicate(base[i], other[i])) { |
| 179 | return false; |
| 180 | } |
| 181 | } |
| 182 | return true; |
| 183 | } |
| 184 | |
| 185 | export function areAllEquivalent<T extends {isEquivalent(other: T): boolean}>( |
| 186 | base: T[], |
no outgoing calls
no test coverage detected
searching dependent graphs…