Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const parseCookies = (url, str) => {
const domain = `.${getDomain(url)}`
return str.split(';').reduce((acc, str) => {
const [name, value] = str.split('=')
const cookie = {
name: name.trim(),
value,
domain,
url,
path: '/'
}
return [...acc, cookie]
}, [])
}