mirror of
https://github.com/Snigdha-OS/package-browser.git
synced 2025-09-07 13:15:16 +02:00
Refactor: Update and remove comments
This commit is contained in:
@@ -23,7 +23,8 @@ export function Header({
|
||||
const usedRepositories = new Set(Object.values(MIRRORS).map(mirror => mirror.repository));
|
||||
|
||||
const filteredRepository = Object.keys(Repository).reduce((acc, key) => {
|
||||
// Говно-код :D
|
||||
// This code is flawed because it explicitly checks for 'ALL', reducing flexibility.
|
||||
// A more generic approach should be used to filter unused repositories while preserving 'ALL'.
|
||||
if ((key === 'ALL') || usedRepositories.has(Repository[key as keyof typeof Repository])) acc[key] = Repository[key as keyof typeof Repository];
|
||||
return acc;
|
||||
}, {} as Record<string, string>);
|
||||
|
@@ -8,10 +8,6 @@ export const MIRRORS: Record<string, {
|
||||
url: string;
|
||||
repository: Repository;
|
||||
}> = {
|
||||
/**
|
||||
* Сейчас данный код будет удобным вариантом,
|
||||
* чтобы убрать убирать пустые (неиспользуемые) репозитории из главной страницы
|
||||
*/
|
||||
'core': {
|
||||
url: 'https://raw.githubusercontent.com/Snigdha-OS/snigdhaos-core/refs/heads/master/packages.txt',
|
||||
repository: ('core' as Repository)
|
||||
|
Reference in New Issue
Block a user