Skip to content

Commit

Permalink
feat: ✨ Update projects
Browse files Browse the repository at this point in the history
  • Loading branch information
viarotel committed Oct 17, 2024
1 parent cc35bfe commit ee8c2ad
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/data/repos.data.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`, {
Expand All @@ -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
}
Expand Down

0 comments on commit ee8c2ad

Please sign in to comment.