Repository URL to install this package:
|
Version:
2.7.11 ▾
|
function getSlotOrder(position: number, index: number, count: number) {
if (index - position < 0) {
return count - Math.abs(index - position)
}
return index - position
}
function validatePosition(index: number, count: number) {
return index < 0 ? Math.abs(index) * 2 : index > count - 1 ? 0 : index
}
export { getSlotOrder, validatePosition, validatePosition as toValidPosition }