enable tsconfig strict mode & fix type errors

This commit is contained in:
James Fenn
2023-10-20 16:51:14 -04:00
parent c7f6ee4a9e
commit a9e918dc1e
57 changed files with 323 additions and 246 deletions

View File

@@ -58,9 +58,9 @@ async function generateCollectionEPub(
collectionPosts: PostInfo[],
fileLocation: string,
) {
const authors = collection.authors.map((id) => {
return getUnicornById(id, collection.locale).name;
});
const authors = collection.authors
.map((id) => getUnicornById(id, collection.locale)?.name)
.filter((name): name is string => !!name);
const epub = new EPub(
{