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

Function validateName

eng/validate-plugins.mjs:11–27  ·  view source on GitHub ↗
(name, folderName)

Source from the content-addressed store, hash-verified

9
10// Validation functions
11function validateName(name, folderName) {
12 const errors = [];
13 if (!name || typeof name !== "string") {
14 errors.push("name is required and must be a string");
15 return errors;
16 }
17 if (name.length < 1 || name.length > 50) {
18 errors.push("name must be between 1 and 50 characters");
19 }
20 if (!/^[a-z0-9-]+$/.test(name)) {
21 errors.push("name must contain only lowercase letters, numbers, and hyphens");
22 }
23 if (name !== folderName) {
24 errors.push(`name "${name}" must match folder name "${folderName}"`);
25 }
26 return errors;
27}
28
29function validateDescription(description) {
30 if (!description || typeof description !== "string") {

Callers 1

validatePluginFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected