2
0

refactor(domain): Improve format feedback

This commit is contained in:
Baptiste Arnaud
2022-03-25 16:30:43 +01:00
parent d756dff99e
commit 90e837e7c2

View File

@ -177,6 +177,7 @@ export const CustomDomainModal = ({
const splitHostname = (
hostname: string
): { domain: string; type: string; subdomain: string } | undefined => {
if (!hostname.includes('.')) return
const urlParts = /([a-z-0-9]{2,63}).([a-z.]{2,5})$/.exec(hostname)
if (!urlParts) return
const [, domain, type] = urlParts