CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-escape-string-regexp

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

100

1.00x
Quality

Pending

Does it follow best practices?

Impact

100%

1.00x

Average score across 7 eval scenarios

SecuritybySnyk

Pending

The risk profile of this skill

Overview
Eval results
Files

criteria.jsonevals/scenario-2/

{
  "context": "This criteria evaluates how well the engineer uses the escape-string-regexp package to safely handle special RegExp characters when implementing a text search utility. The focus is on proper usage of the escapeStringRegexp function to prevent regex injection and enable literal text matching.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "Package Import",
      "description": "Correctly imports the escapeStringRegexp function from the escape-string-regexp package using proper ES module or CommonJS syntax",
      "max_score": 10
    },
    {
      "name": "Escape Search Term",
      "description": "Uses escapeStringRegexp to escape the search term before constructing a RegExp in the searchText function",
      "max_score": 30
    },
    {
      "name": "RegExp Construction",
      "description": "Constructs a RegExp using the escaped string returned by escapeStringRegexp with appropriate flags for case sensitivity",
      "max_score": 25
    },
    {
      "name": "Global Matching",
      "description": "Uses escapeStringRegexp with RegExp global flag ('g') in the findAllMatches function to find all occurrences",
      "max_score": 20
    },
    {
      "name": "Case Insensitivity",
      "description": "Applies escapeStringRegexp before creating RegExp with case-insensitive flag ('i') when caseSensitive option is false",
      "max_score": 15
    }
  ]
}

tile.json