Library to work against complex domain names, subdomains and URIs
82
{
"context": "This criteria evaluates how effectively an engineer uses the tldts package to extract domain information from URLs. It focuses specifically on the correct usage of tldts functions and proper handling of the result data structure.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Import tldts",
"description": "Correctly imports the parse function (or equivalent functions like getDomain, getHostname, getSubdomain, getPublicSuffix) from the tldts package",
"max_score": 10
},
{
"name": "Use parse function",
"description": "Uses the tldts parse() function to extract URL components, or uses the specialized functions (getDomain, getHostname, getSubdomain, getPublicSuffix) appropriately",
"max_score": 25
},
{
"name": "Extract domain field",
"description": "Correctly accesses and returns the 'domain' field from the tldts result object (IResult interface)",
"max_score": 15
},
{
"name": "Extract subdomain field",
"description": "Correctly accesses and returns the 'subdomain' field from the tldts result object",
"max_score": 15
},
{
"name": "Extract publicSuffix field",
"description": "Correctly accesses and returns the 'publicSuffix' field from the tldts result object",
"max_score": 15
},
{
"name": "Extract hostname field",
"description": "Correctly accesses and returns the 'hostname' field from the tldts result object",
"max_score": 10
},
{
"name": "Handle isIp detection",
"description": "Correctly accesses and returns the 'isIp' field from the tldts result object to determine if the URL is an IP address",
"max_score": 10
}
]
}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