summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/astro-rss/src/index.ts25
1 files changed, 12 insertions, 13 deletions
diff --git a/packages/astro-rss/src/index.ts b/packages/astro-rss/src/index.ts
index 738e696f3..c8cf19d60 100644
--- a/packages/astro-rss/src/index.ts
+++ b/packages/astro-rss/src/index.ts
@@ -109,22 +109,21 @@ async function validateRssOptions(rssOptions: RSSOptions) {
const formattedError = new Error(
[
`[RSS] Invalid or missing options:`,
- ...parsedResult.error.errors.map(
- (zodError) => {
- const path = zodError.path.join('.');
- const message = `${zodError.message} (${path})`;
- const code = zodError.code;
+ ...parsedResult.error.errors.map((zodError) => {
+ const path = zodError.path.join('.');
+ const message = `${zodError.message} (${path})`;
+ const code = zodError.code;
- if (path === 'items' && code === 'invalid_union') {
- return [
- message,
+ if (path === 'items' && code === 'invalid_union') {
+ return [
+ message,
`The \`items\` property requires properly typed \`title\`, \`pubDate\`, and \`link\` keys.`,
- `Check your collection's schema, and visit https://docs.astro.build/en/guides/rss/#generating-items for more info.`
- ].join('\n')
- }
+ `Check your collection's schema, and visit https://docs.astro.build/en/guides/rss/#generating-items for more info.`,
+ ].join('\n');
+ }
- return message;
- }),
+ return message;
+ }),
].join('\n')
);
throw formattedError;