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

Function validateImageExtension

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

Source from the content-addressed store, hash-verified

75 */
76
77const validateImageExtension = (picture?: string): boolean => {
78 if (!picture) return true;
79 return commonImageExtensions.some(ext => picture.includes(`.${ext}`));
80};
81
82/**
83 * Validate that a picture URL is valid. A valid picture URL either:

Callers 1

isValidPictureUrlFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected