Something went wrong. Try again.
a Page to view some global statistics about Modrinth modrinth-statistics.tobinio.dev
Something went wrong. Try again.
477 B · 25 lines
TypeScript
at icons
1234567891011121314151617181920212223242526import type { ProjectStatCategory, ProjectStatsValue,} from "~~/server/utils/processing/projects/types";
export function statStringToExtraction(stat: ProjectStatCategory) { let typeFn: (value: ProjectStatsValue) => number;
switch (stat) { case "versions": { typeFn = (value) => value.versions; break; } case "count": { typeFn = (value) => value.count; break; } default: { typeFn = (value) => value.downloads; break; } }
return typeFn;}