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

Function isValidPictureUrl

api/src/routes/protected/settings.ts:90–93  ·  view source on GitHub ↗
(picture?: string)

Source from the content-addressed store, hash-verified

88 * @returns Whether the picture URL is considered valid.
89 */
90const isValidPictureUrl = (picture?: string): boolean => {
91 if (!picture) return true;
92 return isPictureWithProtocol(picture) && validateImageExtension(picture);
93};
94
95const ALLOWED_DOMAINS_MAP = {
96 githubProfile: ['github.com'],

Callers 1

settingRoutesFunction · 0.85

Calls 2

isPictureWithProtocolFunction · 0.85
validateImageExtensionFunction · 0.85

Tested by

no test coverage detected