Skip to content
Open
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
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
44 changes: 36 additions & 8 deletions src/feeds/atom/references/atom-ns.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,27 @@
"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"],
"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",
Expand Down Expand Up @@ -695,13 +709,27 @@
}
],
"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"],
"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",
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
44 changes: 36 additions & 8 deletions src/feeds/rdf/references/rdf-ns.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,27 @@
"encoded": "This is an example of content."
},
"dc": {
"creator": "Jack Jackson",
"contributor": "Assistant Editor Mike Thompson",
"date": "2022-01-01T12:00+00:00",
"description": "This article explores advanced concepts in technology",
"titles": ["Dublin Core Enhanced Item Title"],
"creators": ["Jack Jackson"],
"subjects": ["Article, Tutorial, Example"],
"descriptions": ["This article explores advanced concepts in technology"],
"publishers": ["Example News Organization"],
"contributors": ["Assistant Editor Mike Thompson"],
"dates": ["2022-01-01T12:00+00:00"],
"types": ["Article"],
"formats": ["text/html"],
"identifiers": ["urn:uuid:item-98765432-9876-9876-9876-987654321def"],
"sources": ["https://example.org/item-source"],
"languages": ["en-US"],
"relations": ["https://example.org/related-article"],
"coverages": ["United States"],
"title": "Dublin Core Enhanced Item Title",
"creator": "Jack Jackson",
"subject": "Article, Tutorial, Example",
"description": "This article explores advanced concepts in technology",
"publisher": "Example News Organization",
"contributor": "Assistant Editor Mike Thompson",
"date": "2022-01-01T12:00+00:00",
"type": "Article",
"format": "text/html",
"identifier": "urn:uuid:item-98765432-9876-9876-9876-987654321def",
Expand Down Expand Up @@ -623,13 +637,27 @@
}
],
"dc": {
"creator": "John Doe",
"contributor": "Jane Smith",
"date": "2022-01-01T12:00+00:00",
"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:00"],
"types": ["Text"],
"formats": ["application/rdf+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"],
"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:00",
"type": "Text",
"format": "application/rdf+xml",
"identifier": "urn:uuid:12345678-1234-1234-1234-123456789abc",
Expand Down
Loading