forked from DebaucheryLibrarian/traxxx
17 lines
293 B
JavaScript
17 lines
293 B
JavaScript
'use strict';
|
|
|
|
function cookieToData(cookieString) {
|
|
return cookieString.split('; ').reduce((acc, cookie) => {
|
|
const [key, value] = cookie.split('=');
|
|
|
|
return {
|
|
...acc,
|
|
[key]: value,
|
|
};
|
|
}, {});
|
|
}
|
|
|
|
module.exports = {
|
|
cookieToData,
|
|
};
|