CtrlK
CommunityDocumentationLog inGet started
Tessl Logo

tessl/npm-escape-string-regexp

Escape RegExp special characters in strings for safe use in regular expressions

Overall
score

100%

Evaluation100%

1.00x

Agent success when using this tile

Overview
Eval results
Files

rubric.jsonevals/scenario-4/

{
  "context": "This criteria evaluates how well the engineer uses the escape-string-regexp package to implement a safe regex pattern builder. The focus is on demonstrating understanding of minimal escaping strategies and proper integration of the package's core functionality.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "Package import",
      "description": "Correctly imports the escape-string-regexp package using require() or import statement",
      "max_score": 10
    },
    {
      "name": "Core function usage",
      "description": "Uses escapeStringRegexp() function (or the default export) to escape the search term string before using it in a RegExp",
      "max_score": 30
    },
    {
      "name": "Minimal escaping verification",
      "description": "Implementation relies on the package's minimal escaping approach - does not add additional unnecessary escaping or transformations beyond what the package provides",
      "max_score": 20
    },
    {
      "name": "Pattern string usage",
      "description": "Takes the escaped string returned by escapeStringRegexp() and correctly uses it to construct a RegExp object (e.g., new RegExp(escapedString))",
      "max_score": 20
    },
    {
      "name": "Error handling delegation",
      "description": "Allows the package's built-in TypeError for non-string inputs to propagate, or explicitly checks input type before calling the package function",
      "max_score": 10
    },
    {
      "name": "Test implementation",
      "description": "Test cases verify that the escaped pattern matches expected strings and demonstrate that special characters are handled correctly by the package",
      "max_score": 10
    }
  ]
}

Install with Tessl CLI

npx tessl i tessl/npm-escape-string-regexp@5.0.0

tile.json