e4dcfc49aa
Tests / Import Check (Python 3.13) (push) Has been cancelled
Tests / Import Check (Python 3.14) (push) Has been cancelled
Tests / Python Tests (Python 3.11) (push) Has been cancelled
Tests / Python Tests (Python 3.12) (push) Has been cancelled
Tests / Python Tests (Python 3.14) (push) Has been cancelled
Tests / Test Summary (push) Has been cancelled
Tests / Lint and Format (push) Has been cancelled
Tests / Web Node Tests (push) Has been cancelled
Tests / Import Check (Python 3.11) (push) Has been cancelled
Tests / Import Check (Python 3.12) (push) Has been cancelled
Tests / Python Tests (Python 3.13) (push) Has been cancelled
16 lines
424 B
TypeScript
16 lines
424 B
TypeScript
export const SKILL_NAME_PATTERN = "^[a-z0-9][a-z0-9-]{0,63}$";
|
|
export const SKILL_NAME_RE = /^[a-z0-9][a-z0-9-]{0,63}$/;
|
|
|
|
export function slugifySkillName(raw: string): string {
|
|
return raw
|
|
.toLowerCase()
|
|
.replace(/[\s_]+/g, "-")
|
|
.replace(/[^a-z0-9-]/g, "")
|
|
.replace(/-{2,}/g, "-")
|
|
.replace(/^-+/, "");
|
|
}
|
|
|
|
export function isValidSkillName(value: string): boolean {
|
|
return SKILL_NAME_RE.test(value);
|
|
}
|