Skip to content

Commit

Permalink
Use literals
Browse files Browse the repository at this point in the history
  • Loading branch information
bluwy committed Jul 18, 2023
1 parent 5301822 commit af64612
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion packages/astro/src/core/config/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,21 @@ export const AstroConfigSchema = z.object({
redirects: z
.record(
z.string(),
z.union([z.string(), z.object({ status: z.number(), destination: z.string() })])
z.union([
z.string(),
z.object({
status: z.union([
z.literal(300),
z.literal(301),
z.literal(302),
z.literal(303),
z.literal(304),
z.literal(307),
z.literal(308),
]),
destination: z.string(),
}),
])
)
.default(ASTRO_CONFIG_DEFAULTS.redirects),
image: z
Expand Down

0 comments on commit af64612

Please sign in to comment.