Unverified Commit 32383521 authored by S. Suzuki's avatar S. Suzuki Committed by GitHub

fix(ts): More strict Redirect type (#38277)

* fix(ts): More strict Redirect type

* lint-fix
Co-authored-by: 's avatarJJ Kasper <jj@jjsweb.site>
parent dc13c12c
......@@ -42,9 +42,16 @@ export type Redirect = {
basePath?: false
locale?: false
has?: RouteHas[]
statusCode?: number
permanent?: boolean
}
} & (
| {
statusCode?: never
permanent: boolean
}
| {
statusCode: number
permanent?: never
}
)
export const allowedStatusCodes = new Set([301, 302, 303, 307, 308])
const allowedHasTypes = new Set(['header', 'cookie', 'query', 'host'])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment