summaryrefslogtreecommitdiff
path: root/packages/astro-rss/src/schema.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/astro-rss/src/schema.ts')
-rw-r--r--packages/astro-rss/src/schema.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/packages/astro-rss/src/schema.ts b/packages/astro-rss/src/schema.ts
index 1c2db762d..c4a0fec3f 100644
--- a/packages/astro-rss/src/schema.ts
+++ b/packages/astro-rss/src/schema.ts
@@ -5,9 +5,9 @@ export const rssSchema = z.object({
description: z.string().optional(),
pubDate: z
.union([z.string(), z.number(), z.date()])
- .optional()
- .transform((value) => (value === undefined ? value : new Date(value)))
- .refine((value) => (value === undefined ? value : !isNaN(value.getTime()))),
+ .transform((value) => new Date(value))
+ .refine((value) => !isNaN(value.getTime()))
+ .optional(),
customData: z.string().optional(),
categories: z.array(z.string()).optional(),
author: z.string().optional(),