mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 03:19:46 +00:00
refactor: don't parse twice
This commit is contained in:
parent
a690a2ff6f
commit
e8c66c77fc
1 changed files with 3 additions and 1 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue