Skip to content

Commit

Permalink
fix(nuxt): add undefined type for useCookie return value
Browse files Browse the repository at this point in the history
  • Loading branch information
cany748 committed Apr 7, 2023
1 parent b068f79 commit 4f0b3c7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/nuxt/src/app/composables/cookie.ts
Expand Up @@ -27,7 +27,7 @@ const CookieDefaults: CookieOptions<any> = {
encode: val => encodeURIComponent(typeof val === 'string' ? val : JSON.stringify(val))
}

export function useCookie <T = string | null> (name: string, _opts?: CookieOptions<T>): CookieRef<T> {
export function useCookie <T = string | null | undefined> (name: string, _opts?: CookieOptions<T>): CookieRef<T> {
const opts = { ...CookieDefaults, ..._opts }
const cookies = readRawCookies(opts) || {}

Expand Down

0 comments on commit 4f0b3c7

Please sign in to comment.