From ec94421ea37fa227ccebab6f017542460199fc67 Mon Sep 17 00:00:00 2001 From: fratzinger <22286818+fratzinger@users.noreply.github.com> Date: Tue, 1 Nov 2022 22:40:36 +0100 Subject: [PATCH] chore(docs): Fix search awesome (#2842) --- docs/awesome/PackageCard.vue | 2 -- docs/awesome/Packages.vue | 6 +----- docs/awesome/helpers.ts | 2 -- 3 files changed, 1 insertion(+), 9 deletions(-) diff --git a/docs/awesome/PackageCard.vue b/docs/awesome/PackageCard.vue index 557547e135..9e90b0fdda 100644 --- a/docs/awesome/PackageCard.vue +++ b/docs/awesome/PackageCard.vue @@ -22,7 +22,6 @@ const formatDistance = (date: Date, baseDate: Date) => { try { return _formatDistance(date, new Date()) } catch (err) { - console.error(err) return '' } } @@ -30,7 +29,6 @@ const formatDate = (date: Date) => { try { return intlFormat.format(date) } catch (err) { - console.error(err) return '' } } diff --git a/docs/awesome/Packages.vue b/docs/awesome/Packages.vue index 4964ca2112..cbf6c26e3c 100644 --- a/docs/awesome/Packages.vue +++ b/docs/awesome/Packages.vue @@ -24,10 +24,7 @@ async function getPackageStats(): Promise { pkg.hasNPM = hasNPM }) - console.log(packages) - const uniq = uniqBy(packages, (pkg) => pkg.id) - console.log(uniq) return uniq } @@ -110,7 +107,7 @@ const filteredPackages = computed(() => { const _search = search.value.toLowerCase() pkgs = pkgs.filter( (pkg) => - pkg.name.includes(_search) || + pkg.id.includes(_search) || pkg.description?.includes(_search) || pkg.keywords?.some((keyword) => keyword.includes(_search)) ) @@ -144,7 +141,6 @@ const packagesToShow = computed(() => { return 0 } }) - console.log(result.map((x) => x[key])) return result }) diff --git a/docs/awesome/helpers.ts b/docs/awesome/helpers.ts index 080a3e2332..3b21ba3883 100644 --- a/docs/awesome/helpers.ts +++ b/docs/awesome/helpers.ts @@ -22,9 +22,7 @@ export const uniqBy = (arr: T[], selector: (item: T) => V) => const map = new Map() arr.forEach((item) => { const prop = selector(item) - console.log(prop) if (!map.has(prop)) map.set(prop, item) }) - console.log(map.values()) return [...map.values()] }