All files / Helpers getCookie.js

80% Statements 4/5
50% Branches 1/2
100% Functions 1/1
100% Lines 4/4

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 720x 275x 275x 275x      
const getCookie = name => {
    const value = `; ${document?.cookie}`;
    const parts = value.split(`; ${name}=`);
    Iif (parts.length === 2) return parts.pop().split(';').shift();
}
 
export default getCookie;