allow handles to start with a number (#1231)

* allow handles to start with a number

* don't allow leading hyphen
zio/stable
Eric Bailey 2023-08-21 15:37:57 -05:00 committed by GitHub
parent 257c15ec1f
commit 4cc2695d84
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -3,7 +3,7 @@ export function makeValidHandle(str: string): string {
str = str.slice(0, 20) str = str.slice(0, 20)
} }
str = str.toLowerCase() str = str.toLowerCase()
return str.replace(/^[^a-z]+/g, '').replace(/[^a-z0-9-]/g, '') return str.replace(/^[^a-z0-9]+/g, '').replace(/[^a-z0-9-]/g, '')
} }
export function createFullHandle(name: string, domain: string): string { export function createFullHandle(name: string, domain: string): string {