MCPcopy Create free account
hub / github.com/smallfawn/QLScriptPublic / parseCookie

Function parseCookie

wxapp/wps.js:85–93  ·  view source on GitHub ↗
(cookie = "")

Source from the content-addressed store, hash-verified

83}
84
85function parseCookie(cookie = "") {
86 if (!cookie || typeof cookie !== "string") return {};
87 return Object.fromEntries(
88 cookie
89 .split(/;\s*/)
90 .filter((v) => v.includes("="))
91 .map((v) => [v.slice(0, v.indexOf("=")).trim(), v.slice(v.indexOf("=") + 1).trim()])
92 );
93}
94
95function cookieHeader(cookies = {}) {
96 return Object.entries(cookies)

Callers 2

constructorMethod · 0.85
loadCacheMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected