Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/feeds/atom/generate/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ describe('generate', () => {
updated: new Date('2023-03-15T12:00:00Z'),
dc: {
creator: 'John Doe',
rights: 'Copyright 2023',
rights: ['Copyright 2023'],
},
sy: {
updatePeriod: 'daily',
Expand Down
4 changes: 2 additions & 2 deletions src/feeds/atom/generate/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1005,7 +1005,7 @@ describe('generateFeed', () => {
updated: new Date('2023-03-15T12:00:00Z'),
dc: {
creator: 'Jane Smith',
rights: 'Copyright 2023',
rights: ['Copyright 2023'],
},
}
const expected = {
Expand All @@ -1016,7 +1016,7 @@ describe('generateFeed', () => {
title: 'Feed with namespaces',
updated: '2023-03-15T12:00:00.000Z',
'dc:creator': 'Jane Smith',
'dc:rights': 'Copyright 2023',
'dc:rights': ['Copyright 2023'],
},
}

Expand Down
14 changes: 14 additions & 0 deletions src/feeds/atom/parse/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,7 @@ describe('parse', () => {
updated: '2024-01-01T00:00:00Z',
dc: {
creator: 'John Doe',
creators: ['John Doe'],
},
},
],
Expand Down Expand Up @@ -433,7 +434,9 @@ describe('parse', () => {
updated: '2024-01-01T00:00:00Z',
dc: {
creator: 'John Doe',
creators: ['John Doe'],
date: '2023-01-01',
dates: ['2023-01-01'],
},
},
{
Expand Down Expand Up @@ -473,6 +476,7 @@ describe('parse', () => {
updated: '2024-01-01T00:00:00Z',
dc: {
creator: 'John Doe',
creators: ['John Doe'],
},
},
],
Expand Down Expand Up @@ -565,7 +569,9 @@ describe('parse', () => {
updated: '2024-01-01T00:00:00Z',
dc: {
creator: 'John Doe',
creators: ['John Doe'],
date: '2023-01-01',
dates: ['2023-01-01'],
},
media: {
title: { value: 'Media Title' },
Expand Down Expand Up @@ -615,6 +621,7 @@ describe('parse', () => {
updated: '2024-01-01T00:00:00Z',
dc: {
creator: 'Should not normalize (empty URI)',
creators: ['Should not normalize (empty URI)'],
},
},
],
Expand Down Expand Up @@ -668,6 +675,7 @@ describe('parse', () => {
title: 'Incomplete Entry',
dc: {
creator: 'John Doe',
creators: ['John Doe'],
},
},
],
Expand Down Expand Up @@ -737,6 +745,7 @@ describe('parse', () => {
updated: '2024-01-01T00:00:00Z',
dc: {
creator: 'John',
creators: ['John'],
},
},
],
Expand Down Expand Up @@ -771,6 +780,7 @@ describe('parse', () => {
updated: '2024-01-01T00:00:00Z',
dc: {
creator: 'John',
creators: ['John'],
},
},
],
Expand Down Expand Up @@ -805,6 +815,7 @@ describe('parse', () => {
updated: '2024-01-01T00:00:00Z',
dc: {
creator: 'John',
creators: ['John'],
},
},
],
Expand Down Expand Up @@ -839,6 +850,7 @@ describe('parse', () => {
updated: '2024-01-01T00:00:00Z',
dc: {
creator: 'John',
creators: ['John'],
},
},
],
Expand Down Expand Up @@ -873,6 +885,7 @@ describe('parse', () => {
updated: '2024-01-01T00:00:00Z',
dc: {
creator: 'John',
creators: ['John'],
},
},
],
Expand Down Expand Up @@ -907,6 +920,7 @@ describe('parse', () => {
updated: '2024-01-01T00:00:00Z',
dc: {
creator: 'John',
creators: ['John'],
},
},
],
Expand Down
10 changes: 8 additions & 2 deletions src/feeds/atom/parse/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -992,7 +992,10 @@ describe('parseEntry', () => {
const expected = {
id: 'urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a',
title: 'Example Entry',
dc: { creator: 'John Doe' },
dc: {
creator: 'John Doe',
creators: ['John Doe'],
},
}

expect(parseEntry(value)).toEqual(expected)
Expand Down Expand Up @@ -1493,7 +1496,10 @@ describe('parseFeed', () => {
const expected = {
id: 'urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a',
title: 'Example Feed',
dc: { creator: 'John Doe' },
dc: {
creator: 'John Doe',
creators: ['John Doe'],
},
}

expect(parseFeed(value)).toEqual(expected)
Expand Down
52 changes: 40 additions & 12 deletions src/feeds/atom/references/atom-ns.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,35 @@
"id": "example-entry",
"title": "Example Entry",
"dc": {
"creator": "Jack Jackson",
"contributor": "Assistant Editor Mike Thompson",
"date": "2022-01-01T12:00:00.000Z",
"description": "Detailed description of the example entry content",
"titles": ["Dublin Core Enhanced Entry Title"],
"creators": ["Jack Jackson"],
"subjects": ["Article, Tutorial, Example"],
"descriptions": ["Detailed description of the example entry content"],
"publishers": ["Example News Organization"],
"contributors": ["Assistant Editor Mike Thompson"],
"dates": ["2022-01-01T12:00:00.000Z"],
"types": ["Article"],
"formats": ["application/xhtml+xml"],
"identifiers": ["urn:uuid:98765432-9876-9876-9876-987654321def"],
"sources": ["https://example.org/entry-source"],
"languages": ["en-US"],
"relations": ["https://example.org/related-entry"],
"coverages": ["United States"],
"rights": ["Copyright 2025 Example News Organization"],
"title": "Dublin Core Enhanced Entry Title",
"creator": "Jack Jackson",
"subject": "Article, Tutorial, Example",
"description": "Detailed description of the example entry content",
"publisher": "Example News Organization",
"contributor": "Assistant Editor Mike Thompson",
"date": "2022-01-01T12:00:00.000Z",
"type": "Article",
"format": "application/xhtml+xml",
"identifier": "urn:uuid:98765432-9876-9876-9876-987654321def",
"source": "https://example.org/entry-source",
"language": "en-US",
"relation": "https://example.org/related-entry",
"coverage": "United States",
"rights": "Copyright 2025 Example News Organization"
"coverage": "United States"
},
"dcterms": {
"created": "2022-01-01T12:00:00.000Z",
Expand Down Expand Up @@ -695,21 +709,35 @@
}
],
"dc": {
"creator": "John Doe",
"contributor": "Jane Smith",
"date": "2022-01-01T12:00:00.000Z",
"description": "This is an example of description.",
"titles": ["Dublin Core Enhanced Feed Title"],
"creators": ["John Doe"],
"subjects": ["Technology, Programming, Web Development"],
"descriptions": ["This is an example of description."],
"publishers": ["Example Publishing Company"],
"contributors": ["Jane Smith"],
"dates": ["2022-01-01T12:00:00.000Z"],
"types": ["Text"],
"formats": ["application/atom+xml"],
"identifiers": ["urn:uuid:12345678-1234-1234-1234-123456789abc"],
"sources": ["https://example.org/original-source"],
"languages": ["en-US"],
"relations": ["https://example.org/related-content"],
"coverages": ["Global"],
"rights": ["Copyright 2025 Example Publishing Company"],
"title": "Dublin Core Enhanced Feed Title",
"creator": "John Doe",
"subject": "Technology, Programming, Web Development",
"description": "This is an example of description.",
"publisher": "Example Publishing Company",
"contributor": "Jane Smith",
"date": "2022-01-01T12:00:00.000Z",
"type": "Text",
"format": "application/atom+xml",
"identifier": "urn:uuid:12345678-1234-1234-1234-123456789abc",
"source": "https://example.org/original-source",
"language": "en-US",
"relation": "https://example.org/related-content",
"coverage": "Global",
"rights": "Copyright 2025 Example Publishing Company"
"coverage": "Global"
},
"dcterms": {
"created": "2022-01-01T12:00:00.000Z",
Expand Down
16 changes: 16 additions & 0 deletions src/feeds/rdf/parse/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ describe('parse', () => {
description: 'Item Description',
dc: {
creator: 'John Doe',
creators: ['John Doe'],
},
},
],
Expand Down Expand Up @@ -320,7 +321,9 @@ describe('parse', () => {
description: 'Item Description',
dc: {
creator: 'John Doe',
creators: ['John Doe'],
date: '2023-01-01',
dates: ['2023-01-01'],
},
},
{
Expand Down Expand Up @@ -362,6 +365,7 @@ describe('parse', () => {
description: 'Item Description',
dc: {
creator: 'John Doe',
creators: ['John Doe'],
},
},
],
Expand Down Expand Up @@ -453,6 +457,7 @@ describe('parse', () => {
description: 'RDF Feed Description',
dc: {
creator: 'Feed Author',
creators: ['Feed Author'],
},
sy: {
updatePeriod: 'hourly',
Expand All @@ -464,7 +469,9 @@ describe('parse', () => {
description: 'Item Description',
dc: {
creator: 'John Doe',
creators: ['John Doe'],
date: '2023-01-01',
dates: ['2023-01-01'],
},
slash: {
comments: 42,
Expand Down Expand Up @@ -506,6 +513,7 @@ describe('parse', () => {
title: 'Item Title',
dc: {
creator: 'Should not normalize (empty URI)',
creators: ['Should not normalize (empty URI)'],
},
},
],
Expand Down Expand Up @@ -565,12 +573,14 @@ describe('parse', () => {
const expected = {
dc: {
creator: 'Channel Author',
creators: ['Channel Author'],
},
items: [
{
title: 'Item without about',
dc: {
creator: 'Item Author',
creators: ['Item Author'],
},
},
],
Expand Down Expand Up @@ -642,6 +652,7 @@ describe('parse', () => {
title: 'Item',
dc: {
creator: 'John',
creators: ['John'],
},
},
],
Expand Down Expand Up @@ -678,6 +689,7 @@ describe('parse', () => {
title: 'Item',
dc: {
creator: 'John',
creators: ['John'],
},
},
],
Expand Down Expand Up @@ -714,6 +726,7 @@ describe('parse', () => {
title: 'Item',
dc: {
creator: 'John',
creators: ['John'],
},
},
],
Expand Down Expand Up @@ -750,6 +763,7 @@ describe('parse', () => {
title: 'Item',
dc: {
creator: 'John',
creators: ['John'],
},
},
],
Expand Down Expand Up @@ -786,6 +800,7 @@ describe('parse', () => {
title: 'Item',
dc: {
creator: 'John',
creators: ['John'],
},
},
],
Expand Down Expand Up @@ -822,6 +837,7 @@ describe('parse', () => {
title: 'Item',
dc: {
creator: 'John',
creators: ['John'],
},
},
],
Expand Down
10 changes: 8 additions & 2 deletions src/feeds/rdf/parse/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,10 @@ describe('parseItem', () => {
const expected = {
title: 'Example Entry',
link: 'http://example.com',
dc: { creator: 'John Doe' },
dc: {
creator: 'John Doe',
creators: ['John Doe'],
},
}

expect(parseItem(value)).toEqual(expected)
Expand Down Expand Up @@ -960,7 +963,10 @@ describe('parseFeed', () => {
link: 'https://example.com/item1',
},
],
dc: { creator: 'John Doe' },
dc: {
creator: 'John Doe',
creators: ['John Doe'],
},
}

expect(parseFeed(value)).toEqual(expected)
Expand Down
Loading