import type { NameType } from '../types.js' export const getNameType = (name: string): NameType => { const labels = name.split('.') const isDotPls = labels[labels.length - 1] === 'pls' if (labels.length === 0) return 'root' if (labels.length === 1) { if (isDotPls) return 'pls-tld' return 'tld' } if (labels.length === 2) { if (isDotPls) return 'pls-2ld' return 'other-2ld' } if (isDotPls) return 'pls-subname' return 'other-subname' }