tessl install tessl/npm-babel-plugin-transform-es2015-sticky-regex@6.24.0Babel plugin that transforms ES2015 sticky regex literals to ES5-compatible RegExp constructor calls
Agent Success
Agent success rate when using this tile
100%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.03x
Baseline
Agent success rate without this tile
97%
Enable compilation of JavaScript sources so sticky regex literals work in runtimes without native y flag support by configuring the build with a sticky-regex Babel transform.
/foo/y emits output where that literal becomes an equivalent RegExp constructor call that preserves the y flag and any other flags present (e.g., /foo/gy becomes new RegExp("foo", "gy")). @testy flag returns output that keeps those literals unchanged (e.g., /foo/gi remains /foo/gi). @testbabel.config.json (or equivalent) that lists the sticky regex transform plugin so consumers can enable it via config, and compilation uses that config entry when transforming sources. @test@generates
/**
* Compiles the provided source string using Babel and the sticky-regex transform config.
* Returns the transpiled code string with sticky regex literals rewritten.
*/
export function compileWithStickySupport(source, filename);
/**
* Loads and returns the Babel configuration that declares the sticky-regex transform plugin.
*/
export function loadBabelConfig();Runs Babel transforms for the compilation pipeline. @satisfied-by
Provides the sticky regex transform declared in the Babel configuration. @satisfied-by