Library to work against complex domain names, subdomains and URIs
82
{
"context": "This criteria evaluates how effectively the engineer uses the tldts package to extract public suffixes (TLDs) from URLs and distinguish between ICANN and private domain types. The focus is on proper usage of tldts API functions and options to solve the URL classification problem.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Public suffix extraction",
"description": "Uses tldts functions (parse, getPublicSuffix, or equivalent) to extract the public suffix/TLD from each URL. The implementation should call tldts methods rather than attempting manual string parsing.",
"max_score": 25
},
{
"name": "ICANN domain identification",
"description": "Uses the isIcann flag from tldts parse results to correctly identify and categorize URLs with ICANN TLDs. Should check the isIcann property returned by tldts to determine if a TLD is official.",
"max_score": 20
},
{
"name": "Private domain handling",
"description": "Configures tldts with allowPrivateDomains option set to true and uses the isPrivate flag to correctly identify and categorize URLs with private suffixes (like s3.amazonaws.com, github.io). Must enable private domain support through options.",
"max_score": 25
},
{
"name": "IP address detection",
"description": "Uses the isIp flag from tldts parse results to identify and properly handle IP addresses by adding them to the unclassified array. Should leverage tldts built-in IP detection rather than custom regex.",
"max_score": 15
},
{
"name": "TLD grouping logic",
"description": "Correctly accumulates counts for each unique TLD by grouping results based on the publicSuffix field returned by tldts. Should use the extracted public suffix to build the count mappings for icannTlds and privateTlds.",
"max_score": 10
},
{
"name": "Invalid URL handling",
"description": "Handles cases where tldts returns null or undefined for domain/publicSuffix fields by adding those URLs to the unclassified array. Should check for null/undefined results from tldts parsing.",
"max_score": 5
}
]
}Install with Tessl CLI
npx tessl i tessl/npm-tldtsdocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10