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-3/

{
  "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-tldts

tile.json