Skip to content

Commit

Permalink
Merge pull request #235 from hasparus/master
Browse files Browse the repository at this point in the history
feat: narrow the argument types for setCookie and parseCookies
  • Loading branch information
maticzav authored Mar 21, 2020
2 parents 1c0b362 + d8d4525 commit 99b8c15
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ function createCookie(
* @param options
*/
export function parseCookies(
ctx?: next.NextPageContext | null | undefined,
ctx?: Pick<next.NextPageContext, 'req'> | null | undefined,
options?: cookie.CookieParseOptions,
) {
if (ctx && ctx.req && ctx.req.headers && ctx.req.headers.cookie) {
Expand All @@ -104,7 +104,7 @@ export function parseCookies(
* @param options
*/
export function setCookie(
ctx: next.NextPageContext | null | undefined,
ctx: Pick<next.NextPageContext, 'res'> | null | undefined,
name: string,
value: string,
options: cookie.CookieSerializeOptions,
Expand Down

0 comments on commit 99b8c15

Please sign in to comment.