Skip to content

Commit a16eb75

Browse files
authored
Merge pull request #105 from Dashron/fix/updateCookieLib
update cookie library
2 parents c2c2623 + f8737e6 commit a16eb75

File tree

3 files changed

+17
-30
lines changed

3 files changed

+17
-30
lines changed

package-lock.json

+11-23
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "roads",
3-
"version": "8.0.0-alpha.3",
3+
"version": "8.0.0-alpha.4",
44
"author": {
55
"name": "Aaron Hedges",
66
"email": "[email protected]",
@@ -30,7 +30,6 @@
3030
},
3131
"devDependencies": {
3232
"@types/content-type": "^1.1.5",
33-
"@types/cookie": "^0.4.1",
3433
"@types/node": "^22.10.3",
3534
"@typescript-eslint/eslint-plugin": "^5.10.1",
3635
"@typescript-eslint/parser": "^5.10.1",
@@ -40,7 +39,7 @@
4039
"dependencies": {
4140
"@types/url-parse": "^1.4.11",
4241
"content-type": "^1.0.4",
43-
"cookie": "^0.4.1",
42+
"cookie": "^1.0.2",
4443
"fast-querystring": "^1.1.2",
4544
"url": "^0.11.4",
4645
"url-parse": "^1.5.10",

src/middleware/cookieMiddleware.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,20 @@ export interface CookieContext extends Context {
2323
* Calling this function will store your new cookies.
2424
* The parameters directly map to the [cookie](https://github.com/jshttp/cookie) module.
2525
*/
26-
setCookie: (name: string, value?: string, options?: cookie.CookieSerializeOptions) => void,
26+
setCookie: (name: string, value?: string, options?: cookie.SerializeOptions) => void,
2727
/**
2828
* Returns an object with all the cookies. It defaults to
2929
* all the request cookies, but merges anything applied via
3030
* setCookie on top (i.e. setCookie will override the request cookie)
3131
*/
32-
getCookies: () => Record<string, string>
32+
getCookies: () => Record<string, string | undefined>
3333
newCookies: NewCookies
3434
}
3535

36-
interface SetCookies {[key: string]: string}
36+
interface SetCookies {[key: string]: string | undefined}
3737
interface NewCookies {[key: string]: {
3838
value: string,
39-
options: cookie.CookieSerializeOptions
39+
options: cookie.SerializeOptions
4040
}}
4141

4242
/**

0 commit comments

Comments
 (0)