From 1bd85f37f2cafe8ce9f0234abc34c3b79727dda6 Mon Sep 17 00:00:00 2001 From: Joel Carter Date: Wed, 4 Sep 2024 09:07:05 -0500 Subject: [PATCH] Simplify ternary --- .../packages/xns/plugins/record/src/helpers/name/Name.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/payload/packages/xns/plugins/record/src/helpers/name/Name.ts b/packages/payload/packages/xns/plugins/record/src/helpers/name/Name.ts index af6475e4a..f623f74ae 100644 --- a/packages/payload/packages/xns/plugins/record/src/helpers/name/Name.ts +++ b/packages/payload/packages/xns/plugins/record/src/helpers/name/Name.ts @@ -65,10 +65,9 @@ export class XnsNameHelper { * @returns ValidSourceTypes */ static isPotentialXnsNameOrHash(source?: string): ValidSourceTypes { + if (isHash(source)) return 'hash' const xnsName = XnsNameHelper.ValidTLDs.some(tld => source?.endsWith(tld)) ? source : null - const hash = isHash(source) ? source : null - - return xnsName ? 'xnsName' : hash ? 'hash' : null + return xnsName ? 'xnsName' : null } static isValid(domainRegistration: DomainRegistration) {