'use strict';

function cookieToData(cookieString) {
    return cookieString.split('; ').reduce((acc, cookie) => {
        const [key, value] = cookie.split('=');

        return {
            ...acc,
            [key]: value,
        };
    }, {});
}

module.exports = {
    cookieToData,
};
