From 58d643bcd8e7ecbef5352d28054669a63b9cfa9e Mon Sep 17 00:00:00 2001 From: Charles Villard Date: Wed, 6 Dec 2023 12:14:25 +0000 Subject: [PATCH] [ci] format --- packages/astro-rss/src/index.ts | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/packages/astro-rss/src/index.ts b/packages/astro-rss/src/index.ts index 738e696f39b6..c8cf19d6022e 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;