theodorejb / es-cookie

A simple, lightweight module for handling cookies
MIT License
45 stars 2 forks source link

Export Cookie Attribute types #8

Closed rkrasiuk closed 4 years ago

rkrasiuk commented 4 years ago

Usage:

(I'm being annoying 😅)

theodorejb commented 4 years ago

What would be the use case for restricting users to one of these particular subsets of CookieAttributes?

rkrasiuk commented 4 years ago

@theodorejb I want to allow the user to configure a subset of cookie attributes. aka the library sets the cookie from user-provided resource (domain), however he might have an option to set a cookie as Strict or None

theodorejb commented 4 years ago

I just published v1.3.2 which exports the CookieAttributes type from the main module. However, I'm not comfortable exporting all the partial types that make it up, since they're really an internal implementation detail which could change and I don't want users to depend on.

If another package developer wants to restrict users to a subset of CookieAttributes, I think it would be better for them to define their own interface.