(name: string)
| 34 | const SKILL_NAME_PATTERN = /^[a-z][a-z0-9]*(-[a-z0-9]+)*$/; |
| 35 | |
| 36 | export function validateSkillName(name: string): void { |
| 37 | if (!name) throw new Error('Skill name is empty.'); |
| 38 | if (name.length > 64) throw new Error(`Skill name too long (${name.length} > 64).`); |
| 39 | if (!SKILL_NAME_PATTERN.test(name)) { |
| 40 | throw new Error( |
| 41 | `Invalid skill name "${name}". Must be lowercase letters/digits/dashes, ` + |
| 42 | `start with a letter, no leading/trailing/consecutive dashes.`, |
| 43 | ); |
| 44 | } |
| 45 | } |
| 46 | |
| 47 | // ─── Staging ──────────────────────────────────────────────────── |
| 48 |
no outgoing calls
no test coverage detected