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

Function extractValid

backend/src/api/controllers/user.ts:939–949  ·  view source on GitHub ↗
(
    src: Record<string, PersonalBest[]>,
    validKeys: string[],
  )

Source from the content-addressed store, hash-verified

937 } = user;
938
939 const extractValid = (
940 src: Record<string, PersonalBest[]>,
941 validKeys: string[],
942 ): Record<string, PersonalBest[]> => {
943 return validKeys.reduce((obj, key) => {
944 if (src?.[key] !== undefined) {
945 obj[key] = src[key];
946 }
947 return obj;
948 }, {});
949 };
950
951 const validTimePbs = extractValid(personalBests.time, [
952 "15",

Callers 1

getProfileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected