CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-babel--plugin-proposal-object-rest-spread

Babel plugin that transforms ECMAScript object rest and spread syntax into ES5-compatible code.

85

1.06x

Quality

Pending

Does it follow best practices?

Impact

85%

1.06x

Average score across 10 eval scenarios

SecuritybySnyk

Pending

The risk profile of this skill

Overview
Eval results
Files

task.mdevals/scenario-3/

Browser-Based Code Transformer

Build a JavaScript module that transforms modern ES6+ code and JSX syntax to ES5-compatible JavaScript that can run in older browsers.

Capabilities

Transform modern JavaScript

  • It transforms arrow functions to regular functions @test
  • It transforms const/let to var @test

Transform JSX

  • It transforms JSX elements to function calls @test

Handle errors gracefully

  • It returns error information when syntax is invalid @test

Implementation

@generates

API

/**
 * Transforms modern JavaScript/JSX code to browser-compatible JavaScript.
 *
 * @param {string} code - The source code to transform
 * @param {Object} options - Transformation options
 * @param {string[]} options.presets - Array of preset names to use (e.g., ['env', 'react'])
 * @returns {Object} Result object containing either transformed code or error details
 * @returns {string} result.code - The transformed code (if successful)
 * @returns {Error} result.error - Error object with message and location (if failed)
 */
function transform(code, options) {
  // IMPLEMENTATION HERE
}

module.exports = { transform };

Dependencies { .dependencies }

@babel/standalone { .dependency }

Provides browser-based JavaScript transformation capabilities.

tile.json