(array: T[], index: number, value: T)
| 408 | } |
| 409 | |
| 410 | function replaceIndex<T>(array: T[], index: number, value: T) { |
| 411 | if (array[index] === value) { |
| 412 | return array; |
| 413 | } |
| 414 | |
| 415 | return [...array.slice(0, index), value, ...array.slice(index + 1)]; |
| 416 | } |
| 417 | |
| 418 | function convertValue(value?: number | number[]) { |
| 419 | if (value == null) { |
no test coverage detected