0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-01-06 20:40:08 -05:00
logto/packages/shared/src/utils/sub-domain.ts

7 lines
271 B
TypeScript

/**
* Checks if the subdomain string is valid
* @param subdomain subdomain string
* @returns boolean indicating whether the subdomain is valid
*/
export const isValidSubdomain = (subdomain: string): boolean =>
/^([\da-z]([\da-z-]{0,61}[\da-z])?)$/.test(subdomain);