Skip to content

Commit

Permalink
[fix] change return type of cookies.get back to string|undefined (#6867)
Browse files Browse the repository at this point in the history
Fixes #6865
  • Loading branch information
cdcarson authored Sep 19, 2022
1 parent c032e59 commit ec456df
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/chatty-moose-love.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sveltejs/kit': patch
---

The return type of cookies.get is string|undefined #6865
2 changes: 1 addition & 1 deletion packages/kit/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ export interface Cookies {
/**
* Gets a cookie that was previously set with `cookies.set`, or from the request headers.
*/
get(name: string, opts?: import('cookie').CookieParseOptions): string | void;
get(name: string, opts?: import('cookie').CookieParseOptions): string | undefined;

/**
* Sets a cookie. This will add a `set-cookie` header to the response, but also make the cookie available via `cookies.get` during the current request.
Expand Down

0 comments on commit ec456df

Please sign in to comment.