- i wrote a comment saying "get all
Set-Cookieheaders" to try to get gh copilot to do it for me because i have no clue how to get multiple withnode-fetch - gh copilot suggested
res.header.get('set-cookie') - i tried it and realized that the cookies are comma-separated
- i start writing some spaghetti code to untangle the cookies
- gh copilot perfectly guesses what i wanted to do and completes it
- i checked, and copilots guess was indeed perfect
- i insert a comment saying "for some g"
- gh copilot suggested "for some god forsaken reason, the cookies are separated by a comma, but cookie values can have commas in them, so we need to do this"
- my ide spellcheck pointed out that it is "godforsaken" and not "god forsaken" and offers to fix it with one click
- i write "computers" and gh copilot guesses exactly what i wanted to write

thinking rocks are black magic
the code that it wrote
let cookieMap = new Map<string, string>()
// for some god forsaken reason, the cookies are separated by a comma
// but cookie values can have commas in them, so we need to do this
cookies.split(/ *[;,] */)
.filter(e=>e.includes('='))
.map(e=>e.split('='))
.map(([k, v]) => cookieMap.set(k, v))
and yes, this breaks every cookie that contains commas, but i dont need them either way lol
