Babel plugin that compiles ES2015 computed properties to ES5-compatible code
88
A tool that transpiles JavaScript code containing ES2015 computed properties into ES5-compatible code.
{ ["x" + foo]: "heh" }, it transpiles to ES5-compatible code @test@generates
/**
* Transpiles JavaScript code containing computed properties to ES5.
*
* @param {string} code - The JavaScript code to transpile.
* @param {object} options - Transformation options.
* @param {boolean} options.loose - Use loose mode (simple assignment) instead of defineProperty.
* @returns {string} The transpiled ES5-compatible code.
*/
function transpile(code, options = {}) {
// IMPLEMENTATION HERE
}
module.exports = { transpile };Provides computed property transformation functionality.
@satisfied-by
Provides Babel transformation infrastructure.
@satisfied-by
Install with Tessl CLI
npx tessl i tessl/npm-babel-plugin-transform-es2015-computed-propertiesdocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10