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%
A small transformer that rewrites sticky regex literals in JavaScript source code into equivalent constructor calls while leaving other expressions untouched.
/foo/y is emitted as new RegExp("foo", "y") in the transformed output. @test/ab+c/gy is emitted as new RegExp("ab+c", "gy"), keeping both flags intact. @test/bar/g stays as the same regex literal in the output. @testnew RegExp("foo", "y") remains unchanged after transformation. @test@generates
/**
* Transforms JavaScript source code by applying a Babel plugin that rewrites sticky regex literals.
*
* @param {string} source - JavaScript source to transform.
* @returns {string} transformed source with sticky regex literals rewritten.
*/
export function transformSource(source);Babel plugin that converts sticky regex literals to RegExp constructor calls.