(user: RawUser)
| 59 | * @returns The shared user object. |
| 60 | */ |
| 61 | export const replacePrivateData = (user: RawUser) => { |
| 62 | const { |
| 63 | showAbout, |
| 64 | showHeatMap, |
| 65 | showCerts, |
| 66 | showDonation, |
| 67 | showLocation, |
| 68 | showName, |
| 69 | showPoints, |
| 70 | showPortfolio, |
| 71 | showExperience, |
| 72 | showTimeLine |
| 73 | } = user.profileUI; |
| 74 | |
| 75 | return { |
| 76 | about: showAbout ? user.about : '', |
| 77 | calendar: showHeatMap ? user.calendar : {}, |
| 78 | completedChallenges: showTimeLine |
| 79 | ? showCerts |
| 80 | ? user.completedChallenges |
| 81 | : user.completedChallenges.filter( |
| 82 | c => c.challengeType !== challengeTypes.step |
| 83 | ) |
| 84 | : [], |
| 85 | isDonating: showDonation ? user.isDonating : null, |
| 86 | joinDate: showAbout ? user.joinDate : '', |
| 87 | location: showLocation ? user.location : '', |
| 88 | name: showName ? user.name : '', |
| 89 | points: showPoints ? user.points : null, |
| 90 | portfolio: showPortfolio ? user.portfolio : [], |
| 91 | experience: showExperience ? user.experience : [] |
| 92 | }; |
| 93 | }; |
| 94 | |
| 95 | const blockedUserAgentParts = ['python', 'google-apps-script', 'curl']; |
| 96 | /** |
no outgoing calls
no test coverage detected