refactor: don't parse twice

This commit is contained in:
P. Reis 2024-10-27 15:41:21 -03:00
parent a690a2ff6f
commit e8c66c77fc

View file

@ -83,7 +83,9 @@ export function extractIdentifier(value: string): string | undefined {
return value;
}
if (tldts.parse(value).isIcann && tldts.parse(value).domain) {
const { isIcann, domain } = tldts.parse(value);
if (isIcann && domain) {
return value;
}
}