MCPcopy Index your code
hub / github.com/coder/coder / displayNameValidator

Function displayNameValidator

site/src/utils/formUtils.ts:110–120  ·  view source on GitHub ↗
(displayName: string)

Source from the content-addressed store, hash-verified

108 .max(maxLenName, `${name} cannot be longer than ${maxLenName} characters`);
109
110export const displayNameValidator = (displayName: string): Yup.StringSchema =>
111 Yup.string()
112 .matches(
113 displayNameRE,
114 `${displayName} must start and end with non-whitespace character`,
115 )
116 .max(
117 displayNameMaxLength,
118 `${displayName} cannot be longer than ${displayNameMaxLength} characters`,
119 )
120 .optional();
121
122export const iconValidator = Yup.string().label("Icon").max(256);

Calls 2

matchesMethod · 0.80
stringMethod · 0.80

Tested by

no test coverage detected