(array, fromIndex, toIndex)
| 86 | } |
| 87 | |
| 88 | export function arrayMove(array, fromIndex, toIndex) { |
| 89 | const newArray = [...array]; |
| 90 | const startIndex = fromIndex < 0 ? newArray.length + fromIndex : fromIndex; |
| 91 | |
| 92 | if (startIndex >= 0 && startIndex < newArray.length) { |
| 93 | const endIndex = toIndex < 0 ? newArray.length + toIndex : toIndex; |
| 94 | const [item] = newArray.splice(fromIndex, 1); |
| 95 | |
| 96 | newArray.splice(endIndex, 0, item); |
| 97 | } |
| 98 | |
| 99 | return newArray; |
| 100 | } |
| 101 | |
| 102 | function getBaseName(name) { |
| 103 | if (!name) return ""; |
nothing calls this directly
no outgoing calls
no test coverage detected