CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-babel-plugin-transform-es2015-sticky-regex

Babel plugin that transforms ES2015 sticky regex literals to ES5-compatible RegExp constructor calls

Overall
score

100%

Overview
Eval results
Files

task.mdevals/scenario-4/

Non-Sticky Regex Pass-Through

A helper that compiles JavaScript source while applying a sticky-regex transform, ensuring regex literals without the y flag stay untouched.

Capabilities

Leaves plain regex unchanged

  • Transforming const re = /abc/; returns code that still contains /abc/; with no constructor wrapper. @test

Preserves other flags without stickiness

  • Transforming const re = /foo/gim; keeps the literal as-is, preserving its flags without wrapping it. @test

Converts sticky regex

  • Transforming const re = /bar/y; emits a constructor form that keeps the same pattern and includes the y flag. @test

Implementation

@generates

API

/**
 * Transforms JavaScript source code using a sticky-regex-aware compilation step.
 * Returns the transformed code as a string.
 */
export function transformRegexSource(sourceCode) {}

Dependencies { .dependencies }

@babel/core { .dependency }

Provides the code transformation pipeline.

@babel/plugin-transform-sticky-regex { .dependency }

Applies sticky-regex handling while skipping non-sticky regex literals.

Install with Tessl CLI

npx tessl i tessl/npm-babel-plugin-transform-es2015-sticky-regex

tile.json