FeDirect/static/known_software.mts

24 lines
549 B
TypeScript
Raw Normal View History

2025-01-12 04:47:05 +01:00
type Software = {
2025-01-12 06:39:38 +01:00
name: string,
2025-01-12 10:14:17 +01:00
nodeinfoName: string,
2025-01-12 04:47:05 +01:00
aliases: string[],
groups: string[],
forkOf?: string,
}
type Group = {
2025-01-12 06:39:38 +01:00
name: string,
2025-01-12 04:47:05 +01:00
aliases: string[],
}
type KnownSoftware = {
software: Record<string, Software>,
groups: Record<string, Group>,
}
2025-02-12 22:27:32 +01:00
export function getName(knownSoftware: KnownSoftware, id: string): string | undefined {
return knownSoftware.software[id]?.name ?? knownSoftware.groups[id].name;
}
2025-01-12 04:47:05 +01:00
export default await fetch("/known-software.json").then(r => r.json()) as KnownSoftware;