From ff9c9f3c6ca125cbe2dd649b1ddc10994c37d440 Mon Sep 17 00:00:00 2001 From: Gabriel Cozma Date: Thu, 5 Jun 2025 17:58:10 +0300 Subject: [PATCH] fix[#1]: none of the feeds vaildate --- src/json.ts | 4 ++-- src/rss.ts | 1 - test.ts | 2 -- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/json.ts b/src/json.ts index e010e1c..1d5c113 100644 --- a/src/json.ts +++ b/src/json.ts @@ -29,14 +29,14 @@ export class JsonFeed extends BaseFeed { home_page_url: this.options.link, feed_url: this.options.feed, icon: this.options.icon, - updated: this.options.updated?.toISOString(), items: this.items.map(( { id, title, url, date_published, content_html }, ) => ({ id, title, url, - date_published: date_published?.toISOString() || new Date().toUTCString, + date_published: date_published?.toISOString() || + new Date().toUTCString(), ...(content_html && { content_html }), })), }; diff --git a/src/rss.ts b/src/rss.ts index 5d97345..f6f06a5 100644 --- a/src/rss.ts +++ b/src/rss.ts @@ -49,7 +49,6 @@ export class RssFeed extends BaseFeed { const emailPart = escapedEmail ? `${escapedEmail} ` : ""; return ( ` ${emailPart}(${escapedName})\n` + - ` ${emailPart}(${escapedName})\n` + ` ${emailPart}(${escapedName})\n` ); }).join(""); diff --git a/test.ts b/test.ts index c6265c1..df5b976 100644 --- a/test.ts +++ b/test.ts @@ -55,7 +55,6 @@ Deno.test("RSS Feed Generation", () => { en-US @feed/feed on JSR.io test@example.org (John Doe) - test@example.org (John Doe) test@example.org (John Doe) First RSS Item @@ -157,7 +156,6 @@ Deno.test("JSON Feed Generation", () => { "title": "JSON Feed Example", "home_page_url": "http://example.com/json-feed", "feed_url": "http://example.com/json-feed/feed.json", - "updated": "2024-10-19T15:12:56.000Z", "items": [ { "id": "1",