CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-tldts

Library to work against complex domain names, subdomains and URIs

82

1.03x
Overview
Eval results
Files

rubric.jsonevals/scenario-5/

{
  "context": "This criteria evaluates how effectively an engineer uses the tldts package to extract domain information from email addresses. The focus is on proper utilization of tldts functions for email domain parsing, including handling of multi-level TLDs, subdomains, and edge cases like IP addresses and internationalized emails.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "Domain extraction",
      "description": "Uses getDomain() or parse() to extract the full registrable domain from email addresses (e.g., 'example.co.uk' from 'user@mail.example.co.uk')",
      "max_score": 25
    },
    {
      "name": "Public suffix extraction",
      "description": "Uses getPublicSuffix() or parse() to extract the TLD/public suffix from email addresses, correctly handling multi-level suffixes (e.g., 'co.uk')",
      "max_score": 20
    },
    {
      "name": "Subdomain extraction",
      "description": "Uses getSubdomain() or parse() to extract the subdomain portion from email domains (e.g., 'mail' from 'user@mail.example.com')",
      "max_score": 20
    },
    {
      "name": "Domain without suffix",
      "description": "Uses getDomainWithoutSuffix() or parse() to extract just the domain name without its TLD (e.g., 'example' from 'user@example.co.uk')",
      "max_score": 15
    },
    {
      "name": "IP detection",
      "description": "Utilizes the isIp flag or IP detection capability from tldts to identify and reject email addresses with IP addresses instead of domains",
      "max_score": 10
    },
    {
      "name": "Unicode/IDNA handling",
      "description": "Correctly handles internationalized email addresses with Unicode characters by leveraging tldts's built-in Unicode/IDNA support",
      "max_score": 10
    }
  ]
}

Install with Tessl CLI

npx tessl i tessl/npm-tldts

tile.json