deno formatting

This commit is contained in:
olaven 2025-04-30 16:18:05 +02:00
parent 0ce01b97f1
commit 2109ae438f
2 changed files with 14 additions and 15 deletions

View File

@ -38,12 +38,12 @@ Deno.test("generated rss contains promo with link to donations page", () => {
const feed = rss.assembleFeed(series); const feed = rss.assembleFeed(series);
const indexOfFirstPromotion = feed.indexOf( const indexOfFirstPromotion = feed.indexOf(
"NRSS er avhengig av din Vipps-støtte" "NRSS er avhengig av din Vipps-støtte",
); );
const indexOfSecondPromotion = feed.indexOf("Vurder å støtte utviklingen"); const indexOfSecondPromotion = feed.indexOf("Vurder å støtte utviklingen");
assertLess( assertLess(
indexOfFirstPromotion, indexOfFirstPromotion,
indexOfSecondPromotion, indexOfSecondPromotion,
"First promotion should come before the second" "First promotion should come before the second",
); );
}); });

View File

@ -39,9 +39,7 @@ function assembleFeed(series: Series): string {
]), ]),
] ]
: []), : []),
...series.episodes.map((episode) => ...series.episodes.map((episode) => assembleEpisode(episode, series.id)),
assembleEpisode(episode, series.id)
),
]), ]),
], ],
[ [
@ -49,14 +47,15 @@ function assembleFeed(series: Series): string {
["xmlns:itunes", "http://www.itunes.com/dtds/podcast-1.0.dtd"], ["xmlns:itunes", "http://www.itunes.com/dtds/podcast-1.0.dtd"],
["xmlns:content", "http://purl.org/rss/1.0/modules/content/"], ["xmlns:content", "http://purl.org/rss/1.0/modules/content/"],
["xmlns:podcast", "https://podcastindex.org/namespace/1.0"], ["xmlns:podcast", "https://podcastindex.org/namespace/1.0"],
] ],
) ),
); );
} }
function descriptionWithDonationPromotion(description: string): string { function descriptionWithDonationPromotion(description: string): string {
const firstPromotion = `NRSS er avhengig av din Vipps-støtte⬇`; const firstPromotion = `NRSS er avhengig av din Vipps-støtte⬇`;
const secondPromotion = `Takk for at du bruker NRSS 🙏🌟 Vurder å støtte utviklingen via Vipps med omtrent det samme som prisen på en kaffekopp. Se mer på https://nrss.deno.dev/`; const secondPromotion =
`Takk for at du bruker NRSS 🙏🌟 Vurder å støtte utviklingen via Vipps med omtrent det samme som prisen på en kaffekopp. Se mer på https://nrss.deno.dev/`;
return `${firstPromotion}\n\n${description}\n\n${secondPromotion}`; return `${firstPromotion}\n\n${description}\n\n${secondPromotion}`;
} }