MCPcopy Create free account
hub / github.com/freeCodeCamp/freeCodeCamp / isValidUsername

Function isValidUsername

packages/shared/src/utils/validate.ts:33–38  ·  view source on GitHub ↗
(str: string)

Source from the content-addressed store, hash-verified

31};
32
33export const isValidUsername = (str: string): Validated => {
34 if (!validCharsRE.test(str)) return invalidCharError;
35 if (str.length < 3) return usernameTooShort;
36 if (isHttpStatusCode(str)) return usernameIsHttpStatusCode;
37 return validationSuccess;
38};
39
40// link template:
41// https://learn.microsoft.com/LOCALE/users/USERNAME/transcript/ID

Callers 3

validateFormInputMethod · 0.90
validate.test.tsFile · 0.90
settingRoutesFunction · 0.90

Calls 1

isHttpStatusCodeFunction · 0.85

Tested by

no test coverage detected