0
0
mirror of https://github.com/honojs/hono.git synced 2024-11-21 18:18:57 +01:00

fix(utils/cookie): partitioned typo in CookieOptions (#3566)

This commit is contained in:
Cotton Hou 2024-10-27 18:37:17 +08:00 committed by GitHub
parent f55dc45a31
commit 3a59d86533
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -8,9 +8,9 @@ import { decodeURIComponent_ } from './url'
export type Cookie = Record<string, string>
export type SignedCookie = Record<string, string | false>
type PartitionCookieConstraint =
| { partition: true; secure: true }
| { partition?: boolean; secure?: boolean } // reset to default
type PartitionedCookieConstraint =
| { partitioned: true; secure: true }
| { partitioned?: boolean; secure?: boolean } // reset to default
type SecureCookieConstraint = { secure: true }
type HostCookieConstraint = { secure: true; path: '/'; domain?: undefined }
@ -25,7 +25,7 @@ export type CookieOptions = {
sameSite?: 'Strict' | 'Lax' | 'None' | 'strict' | 'lax' | 'none'
partitioned?: boolean
prefix?: CookiePrefixOptions
} & PartitionCookieConstraint
} & PartitionedCookieConstraint
export type CookiePrefixOptions = 'host' | 'secure'
export type CookieConstraint<Name> = Name extends `__Secure-${string}`