Request Cookies Should Be Typed As string | undefined
#189
Labels
good first issue
Good for newcomers
string | undefined
#189
Prerequisites
Fastify version
3.29.0
Plugin version
6.0.0
Node.js version
16.15.1
Operating system
Windows
Operating system version (i.e. 20.04, 11.3, 10)
Windows 11 Pro Build 22000.739
Description
Right now when using the package any cookie is always typed as a string when it could be undefined.
Pretty simple fix, just changing the type from
cookies: { [cookieName: string]: string };
tocookies: { [cookieName: string]: string | undefined };
(if you wanted to make it more TypeScript-y you could do
cookies: Record<string, string | undefined>;
Steps to Reproduce
Expected Behavior
No response
The text was updated successfully, but these errors were encountered: