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

Function validateAuthor

eng/external-plugin-validation.mjs:159–179  ·  view source on GitHub ↗
(author, prefix, errors, required)

Source from the content-addressed store, hash-verified

157}
158
159function validateAuthor(author, prefix, errors, required) {
160 if (author === undefined) {
161 if (required) {
162 errors.push(`${prefix}: "author" is required`);
163 }
164 return;
165 }
166
167 if (!author || typeof author !== "object" || Array.isArray(author)) {
168 errors.push(`${prefix}: "author" must be an object`);
169 return;
170 }
171
172 if (!isNonEmptyString(author.name)) {
173 errors.push(`${prefix}: "author.name" is required and must be a non-empty string`);
174 }
175
176 if (author.url !== undefined) {
177 validateHttpsUrl(author.url, "author.url", prefix, errors);
178 }
179}
180
181function validateLicense(license, prefix, errors, required) {
182 if (license === undefined) {

Callers 1

validateExternalPluginFunction · 0.85

Calls 2

isNonEmptyStringFunction · 0.85
validateHttpsUrlFunction · 0.85

Tested by

no test coverage detected