diff --git a/package.json b/package.json
index 2d78561..d942328 100644
--- a/package.json
+++ b/package.json
@@ -30,6 +30,7 @@
"test:watch": "jest --watch",
"start:dev": "esr src/dev.ts",
"dev": "esr src/dev.ts",
+ "debug": "node --inspect-brk -r esbuild-runner/register ",
"dev:watch": "ts-node-dev --respawn --no-notify src/dev.ts",
"deps": "npm-run-all -p deps:*",
"deps:person": "./scripts/update-person-enum.sh",
diff --git a/src/parser/__test__/feed.test.ts b/src/parser/__test__/feed.test.ts
index 1aa8400..705be16 100644
--- a/src/parser/__test__/feed.test.ts
+++ b/src/parser/__test__/feed.test.ts
@@ -763,12 +763,37 @@ describe("feed handling", () => {
feed,
`
Founders Fund
+ `
+ );
+
+ const result = parseFeed(xml);
+ expect(result).toHaveProperty("author", ["Founders Fund"]);
+ });
+
+ it("extracts multiple authors", () => {
+ const xml = helpers.spliceFeed(
+ feed,
+ `
+ Founders Fund
+ Person Fund
+ `
+ );
+ const result = parseFeed(xml);
+ expect(result).toHaveProperty("author", ["Founders Fund", "Person Fund"]);
+ });
+
+ it("ignores empty nodes", () => {
+ const xml = helpers.spliceFeed(
+ feed,
+ `
+
+
`
);
const result = parseFeed(xml);
- expect(result).toHaveProperty("author", "Founders Fund");
+ expect(result).not.toHaveProperty("author");
});
});
diff --git a/src/parser/feed.ts b/src/parser/feed.ts
index bed3055..57d563a 100644
--- a/src/parser/feed.ts
+++ b/src/parser/feed.ts
@@ -525,11 +525,11 @@ function getPubSub(
return { pubsub };
}
-function getAuthor(feed: XmlNode): undefined | { author: string } {
- const node = firstWithValue(feed["itunes:author"]);
+function getAuthor(feed: XmlNode): undefined | { author: string[] } {
+ const nodes = ensureArray(feed["itunes:author"]).filter((n) => getText(n));
- if (node) {
- return { author: getText(node) };
+ if (nodes.length > 0) {
+ return { author: nodes };
}
return undefined;
}
diff --git a/src/parser/types.ts b/src/parser/types.ts
index 3b207e4..92493f7 100644
--- a/src/parser/types.ts
+++ b/src/parser/types.ts
@@ -113,7 +113,7 @@ export interface FeedObject {
categories?: string[];
pubsub?: { hub?: string; self?: string; next?: string };
- author?: string;
+ author?: string[];
owner?: {
email: string;
name: string;