All files / Helpers isWithinBreakpoint.js

53.84% Statements 7/13
41.66% Branches 5/12
100% Functions 1/1
53.84% Lines 7/13

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 1520x 201x   201x   201x 12x 189x 189x            
export const isWithinBreakpoint = (current, breakpoint) => {
    Iif (breakpoint === 'xs') {
        return ['xs', 'sm', 'md', 'lg', 'xl', '2xl'].includes(current);
    } else Iif (breakpoint === 'sm') {
        return ['sm', 'md', 'lg', 'xl', '2xl'].includes(current);
    } else if (breakpoint === 'md') {
        return ['md', 'lg', 'xl', '2xl'].includes(current);
    } else if (breakpoint === 'lg') {
        return ['lg', 'xl', '2xl'].includes(current);
    } else Eif (breakpoint === 'xl') {
        return ['xl', '2xl'].includes(current);
    } else if (breakpoint === '2xl') {
        return ['2xl'].includes(current);
    }
}