* Finds the dest index whose position is different with the current one for `trimSpace: 'move'`. * This can be negative or greater than `length - 1`. * * @param dest - A dest index. * * @return A dest index.
( dest: number )
| 266 | * @return A dest index. |
| 267 | */ |
| 268 | function computeMovableDestIndex( dest: number ): number { |
| 269 | if ( isSlide && options.trimSpace === 'move' && dest !== currIndex ) { |
| 270 | const position = getPosition(); |
| 271 | |
| 272 | while ( position === toPosition( dest, true ) && between( dest, 0, Splide.length - 1, ! options.rewind ) ) { |
| 273 | dest < currIndex ? --dest : ++dest; |
| 274 | } |
| 275 | } |
| 276 | |
| 277 | return dest; |
| 278 | } |
| 279 | |
| 280 | /** |
| 281 | * Loops the provided index only in the loop mode. |
no test coverage detected
searching dependent graphs…