From ee8c2ad3d8b0b3447a78ad5f8c9cc80d361e4a88 Mon Sep 17 00:00:00 2001 From: viarotel Date: Thu, 17 Oct 2024 14:17:54 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E2=9C=A8=20Update=20projects?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/data/repos.data.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/data/repos.data.js b/src/data/repos.data.js index 5f2b9d17..df0e2d5d 100644 --- a/src/data/repos.data.js +++ b/src/data/repos.data.js @@ -2,7 +2,7 @@ import { ofetch } from 'ofetch' const baseURL = 'https://ungh.cc' -const excludes = ['waline-service'] +const whitelist = ['escrcpy', 'cleants', 'vite-uniapp-template', 'markvite', 'packages', 'environments'] async function getRepos() { const res = await ofetch(`${baseURL}/orgs/viarotel-org/repos`, { @@ -11,9 +11,15 @@ async function getRepos() { const repos = res?.repos || [] - const data = repos - .filter(item => !excludes.includes(item.name)) - .sort((a, b) => b.stars - a.stars) + const data = whitelist.reduce((arr, name) => { + const item = repos.find(item => item.name === name) + + if (item) { + arr.push(item) + } + + return arr + }, []) return data }