From e8c66c77fc3d39926e095412422bd2a9f1373a84 Mon Sep 17 00:00:00 2001 From: "P. Reis" Date: Sun, 27 Oct 2024 15:41:21 -0300 Subject: [PATCH] refactor: don't parse twice --- src/utils/lookup.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/utils/lookup.ts b/src/utils/lookup.ts index e8b90ec6..48c6ba81 100644 --- a/src/utils/lookup.ts +++ b/src/utils/lookup.ts @@ -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; } }