(name, prefix, errors)
| 55 | } |
| 56 | |
| 57 | function 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 | |
| 72 | function validateDescription(description, prefix, errors) { |
| 73 | if (!isNonEmptyString(description)) { |
no test coverage detected