(arr: T[], value: T)
| 39 | * Pushes an element to the end of the array, if found. |
| 40 | */ |
| 41 | export function pushToEnd<T>(arr: T[], value: T): void { |
| 42 | const index = arr.indexOf(value); |
| 43 | |
| 44 | if (index > -1) { |
| 45 | arr.splice(index, 1); |
| 46 | arr.push(value); |
| 47 | } |
| 48 | } |
| 49 | |
| 50 | export function firstIndex<T>( |
| 51 | array: T[] | ReadonlyArray<T>, |
no test coverage detected
searching dependent graphs…