Skip to content

Commit

Permalink
Simplify ternary
Browse files Browse the repository at this point in the history
  • Loading branch information
JoelBCarter committed Sep 4, 2024
1 parent 4a5cca5 commit 1bd85f3
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 1bd85f3

Please sign in to comment.