From 24258a6c987aa46c5854d050b5f75dfde13db3b1 Mon Sep 17 00:00:00 2001 From: Rotimi Best Date: Thu, 5 Dec 2024 12:53:21 +0100 Subject: [PATCH] fix: remove brackets from author --- utils/scrape/index.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/utils/scrape/index.ts b/utils/scrape/index.ts index a9c50f4..b5d0baf 100644 --- a/utils/scrape/index.ts +++ b/utils/scrape/index.ts @@ -77,6 +77,10 @@ const fetchDataFromGithub = async ( return repositories; }; +function cleanAuthor(link: string) { + return link.replace(/[\(\)]/g, ''); +} + function convertToJSON(repositories: string[]): ScrapedRepository[] { return repositories.map((repository) => { const parser = new DOMParser(); @@ -92,8 +96,8 @@ function convertToJSON(repositories: string[]): ScrapedRepository[] { return { name, link, - author, - authorLink, + author: cleanAuthor(author), + authorLink: cleanAuthor(authorLink), }; }); }