MCPcopy Create free account
hub / github.com/monkeytypegame/monkeytype / getAllTimeLbs

Function getAllTimeLbs

backend/src/api/controllers/user.ts:1147–1200  ·  view source on GitHub ↗
(uid: string)

Source from the content-addressed store, hash-verified

1145}
1146
1147async function getAllTimeLbs(uid: string): Promise<AllTimeLbs> {
1148 const allTime15English = await LeaderboardsDAL.getRank(
1149 "time",
1150 "15",
1151 "english",
1152 uid,
1153 );
1154
1155 const allTime15EnglishCount = await LeaderboardsDAL.getCount(
1156 "time",
1157 "15",
1158 "english",
1159 );
1160
1161 const allTime60English = await LeaderboardsDAL.getRank(
1162 "time",
1163 "60",
1164 "english",
1165 uid,
1166 );
1167
1168 const allTime60EnglishCount = await LeaderboardsDAL.getCount(
1169 "time",
1170 "60",
1171 "english",
1172 );
1173
1174 const english15 =
1175 allTime15English === false || allTime15English === null
1176 ? undefined
1177 : {
1178 rank: allTime15English.rank,
1179 count: allTime15EnglishCount,
1180 };
1181
1182 const english60 =
1183 allTime60English === false || allTime60English === null
1184 ? undefined
1185 : {
1186 rank: allTime60English.rank,
1187 count: allTime60EnglishCount,
1188 };
1189
1190 return {
1191 time: {
1192 "15": {
1193 english: english15,
1194 },
1195 "60": {
1196 english: english60,
1197 },
1198 },
1199 };
1200}
1201
1202export function generateCurrentTestActivity(
1203 testActivity: CountByYearAndDay | undefined,

Callers 2

getUserFunction · 0.85
getProfileFunction · 0.85

Calls 1

getRankMethod · 0.45

Tested by

no test coverage detected