Function
extractValid
(
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", |
Tested by
no test coverage detected