all numeric is an invalid name

This commit is contained in:
Josh Hawkins 2025-11-04 08:45:32 -06:00
parent 107ed4174c
commit 2d9b54eef0

View File

@ -43,5 +43,5 @@ export function generateFixedHash(name: string, prefix: string = "id"): string {
* @returns True if the name is valid, false otherwise
*/
export function isValidId(name: string): boolean {
return /^[a-zA-Z0-9_-]+$/.test(name);
return /^[a-zA-Z0-9_-]+$/.test(name) && !/^\d+$/.test(name);
}