code refactoring

This commit is contained in:
daniel31x13
2024-06-26 13:54:03 -04:00
parent c68f9d68ad
commit 3618ba907d
7 changed files with 229 additions and 160 deletions
@@ -14,11 +14,9 @@ const archiveAsReadablility = async (content: string, link: Link) => {
const articleText = article?.textContent
.replace(/ +(?= )/g, "") // strip out multiple spaces
.replace(/(\r\n|\n|\r)/gm, " "); // strip out line breaks
if (
articleText &&
articleText !== "" &&
!link.readable?.startsWith("archive")
) {
console.log(articleText);
if (articleText && articleText !== "") {
const collectionId = (
await prisma.link.findUnique({
where: { id: link.id },