in packages/bui-utils/src/hooks/useTouch.ts [7:15]
9 lines of code
5 McCabe index (conditional complexity)
function getDirection(x: number, y: number) {
if (x > y && x > MIN_DISTANCE) {
return 'horizontal';
}
if (y > x && y > MIN_DISTANCE) {
return 'vertical';
}
return '';
}