What's the purpose of the options.sameSite branch of ternary in serialize?
When options.priority is not a string, it will use options.sameSite. There's no overlap in the types between the two, so we'd hit the default and throw. Was there meant to be overlap or is this a typo?
if (options.priority) {
const priority =
typeof options.priority === "string"
? options.priority.toLowerCase()
: options.sameSite; // typo?
switch (priority) {
case "low":
str += "; Priority=Low";
break;
case "medium":
str += "; Priority=Medium";
break;
case "high":
str += "; Priority=High";
break;
default:
throw new TypeError(`option priority is invalid: ${options.priority}`);
}
}
What's the purpose of the
options.sameSitebranch of ternary in serialize?When
options.priorityis not a string, it will useoptions.sameSite. There's no overlap in the types between the two, so we'd hit the default and throw. Was there meant to be overlap or is this a typo?cookie/src/index.ts
Line 314 in 408c2b4