( maybeProfileUI: ProfileUI | null )
| 123 | * @returns The input with nulls removed or a default value if there is no input. |
| 124 | */ |
| 125 | export const normalizeProfileUI = ( |
| 126 | maybeProfileUI: ProfileUI | null |
| 127 | ): DefaultToFalse<ProfileUI> => { |
| 128 | return maybeProfileUI |
| 129 | ? normalizeFlags(maybeProfileUI) |
| 130 | : { |
| 131 | isLocked: true, |
| 132 | showAbout: false, |
| 133 | showCerts: false, |
| 134 | showDonation: false, |
| 135 | showHeatMap: false, |
| 136 | showLocation: false, |
| 137 | showName: false, |
| 138 | showPoints: false, |
| 139 | showPortfolio: false, |
| 140 | showTimeLine: false, |
| 141 | showExperience: false |
| 142 | }; |
| 143 | }; |
| 144 | |
| 145 | /** |
| 146 | * Remove all the null properties from an object. |
no test coverage detected