Public
Script
October 24, 2023
1
2
3
4
5
6
export function parse_cookies(
jar: String,
decoder: (data: string) => string = decodeURIComponent,
): { [key: string]: string } {
return Object.fromEntries(jar.split("; ").map(c => c.split("=").map(x => decoder(x.trim()))));
}
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Comments
Nobody has commented on this val yet: be the first!
October 24, 2023