Skip to content

Commit

Permalink
[ci] format
Browse files Browse the repository at this point in the history
  • Loading branch information
ematipico authored and astrobot-houston committed Dec 6, 2023
1 parent edfae50 commit 58d643b
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions packages/astro-rss/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 58d643b

Please sign in to comment.