Skip to content

What's the purpose of the options.sameSite branch of ternary in serialize? #206

Description

@jonchurch

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?

: options.sameSite;

  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}`);
    }
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions