reduceDocToRow = (acc, doc) => {
const group = doc
.querySelector("title")
.innerHTML.replace(/^.+tagged as (\S+) from Inoreader.+$/, "$1");
const entries = Array.from(doc.querySelectorAll('outline outline')).map(c =>
Object.fromEntries(
Array.from(c.attributes).map(node => [node.name, node.value])
)
);
return acc.concat(
entries.map(({ title, htmlUrl, text, xmlUrl, ...e }) => ({
title,
description: Object.entries(descriptions.htmlUrl).find(([k,v]) => htmlUrl.includes(k))?.[1] || "",
group,
type: types.find(t => xmlUrl.includes(t.term))?.type || e.type,
cadence: descriptions.group[group],
htmlUrl,
text,
xmlUrl
}))
);
}