diff options
author | 2023-12-06 12:14:25 +0000 | |
---|---|---|
committer | 2023-12-06 12:14:25 +0000 | |
commit | 58d643bcd8e7ecbef5352d28054669a63b9cfa9e (patch) | |
tree | 64690e0769ccabbed6b0cd3a8616cfe2cc45d69c | |
parent | edfae50e6ea494f49c6d4fbf4bd4481870f994b1 (diff) | |
download | astro-58d643bcd8e7ecbef5352d28054669a63b9cfa9e.tar.gz astro-58d643bcd8e7ecbef5352d28054669a63b9cfa9e.tar.zst astro-58d643bcd8e7ecbef5352d28054669a63b9cfa9e.zip |
[ci] format
-rw-r--r-- | packages/astro-rss/src/index.ts | 25 |
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; |