mirror of
https://github.com/withastro/astro.git
synced 2025-02-03 22:29:08 -05:00
Fix redirects map object-form value validation (#7701)
This commit is contained in:
parent
de65ad25ea
commit
019b797bf8
2 changed files with 25 additions and 1 deletions
5
.changeset/eleven-eyes-jog.md
Normal file
5
.changeset/eleven-eyes-jog.md
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
'astro': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Fix redirects map object-form value validation
|
|
@ -149,7 +149,26 @@ export const AstroConfigSchema = z.object({
|
||||||
.optional()
|
.optional()
|
||||||
.default({})
|
.default({})
|
||||||
),
|
),
|
||||||
redirects: z.record(z.string(), z.string()).default(ASTRO_CONFIG_DEFAULTS.redirects),
|
redirects: z
|
||||||
|
.record(
|
||||||
|
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
|
image: z
|
||||||
.object({
|
.object({
|
||||||
service: z.object({
|
service: z.object({
|
||||||
|
|
Loading…
Add table
Reference in a new issue