MCPcopy Create free account
hub / github.com/github/awesome-copilot / validatePluginName

Function validatePluginName

eng/external-plugin-validation.mjs:57–70  ·  view source on GitHub ↗
(name, prefix, errors)

Source from the content-addressed store, hash-verified

55}
56
57function validatePluginName(name, prefix, errors) {
58 if (!isNonEmptyString(name)) {
59 errors.push(`${prefix}: "name" is required and must be a non-empty string`);
60 return;
61 }
62
63 if (name.length > 50) {
64 errors.push(`${prefix}: "name" must be 50 characters or fewer`);
65 }
66
67 if (!/^[a-z0-9-]+$/.test(name)) {
68 errors.push(`${prefix}: "name" must contain only lowercase letters, numbers, and hyphens`);
69 }
70}
71
72function validateDescription(description, prefix, errors) {
73 if (!isNonEmptyString(description)) {

Callers 1

validateExternalPluginFunction · 0.85

Calls 1

isNonEmptyStringFunction · 0.85

Tested by

no test coverage detected