MCPcopy Index your code
hub / github.com/freeCodeCamp/freeCodeCamp / normalizeProfileUI

Function normalizeProfileUI

api/src/utils/normalize.ts:125–143  ·  view source on GitHub ↗
(
  maybeProfileUI: ProfileUI | null
)

Source from the content-addressed store, hash-verified

123 * @returns The input with nulls removed or a default value if there is no input.
124 */
125export 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.

Callers 3

normalize.test.tsFile · 0.85
userPublicGetRoutesFunction · 0.85
getSessionUserHandlerFunction · 0.85

Calls 1

normalizeFlagsFunction · 0.85

Tested by

no test coverage detected