CtrlK
CommunityDocumentationLog inGet started
Tessl Logo

tessl/npm-coffeescript

tessl install tessl/npm-coffeescript@2.7.0

A programming language that compiles into JavaScript, offering more concise and readable syntax while maintaining full JavaScript compatibility.

Agent Success

Agent success rate when using this tile

77%

Improvement

Agent success rate improvement when using this tile compared to baseline

1.01x

Baseline

Agent success rate without this tile

76%

task.mdevals/scenario-2/

CoffeeScript Destructuring Utilities

Build a utility module that compiles and evaluates CoffeeScript code featuring complex destructuring patterns. The module should provide functions that demonstrate and test CoffeeScript's destructuring capabilities, including nested structures, default values, rest operators, and object property aliasing.

Capabilities

Compile nested array destructuring

  • Compiles CoffeeScript code with nested array destructuring [a, [b, c]] = [1, [2, 3]] and returns valid JavaScript @test
  • Compiles CoffeeScript with array elision (skipping elements) [a, , c] = [1, 2, 3] and returns valid JavaScript @test

Compile object destructuring with aliasing

  • Compiles CoffeeScript with object property aliasing {old: new} = {old: 'value'} and returns valid JavaScript @test
  • Compiles CoffeeScript with nested object destructuring {a: {b: c}} = {a: {b: 5}} and returns valid JavaScript @test

Compile destructuring with defaults

  • Compiles CoffeeScript with default values in array destructuring [a = 10, b = 20] = [1] and returns valid JavaScript @test
  • Compiles CoffeeScript with default values in object destructuring {x = 5, y = 10} = {x: 3} and returns valid JavaScript @test

Compile destructuring with rest operator

  • Compiles CoffeeScript with rest operator in arrays [first, rest...] = [1, 2, 3, 4] and returns valid JavaScript @test
  • Compiles CoffeeScript with mixed patterns (objects in arrays) [{name}, {age}] = [{name: 'Alice'}, {age: 30}] and returns valid JavaScript @test

Implementation

@generates

API

/**
 * Compiles CoffeeScript code to JavaScript
 * @param {string} coffeeCode - The CoffeeScript code to compile
 * @returns {string} The compiled JavaScript code
 */
function compileDestructuring(coffeeCode) {
  // Implementation
}

/**
 * Compiles and evaluates CoffeeScript code with destructuring
 * @param {string} coffeeCode - The CoffeeScript code to compile and evaluate
 * @returns {any} The result of evaluating the code
 */
function evalDestructuring(coffeeCode) {
  // Implementation
}

module.exports = {
  compileDestructuring,
  evalDestructuring
};

Dependencies { .dependencies }

CoffeeScript { .dependency }

Provides CoffeeScript compilation and evaluation support, particularly for complex destructuring patterns.

@satisfied-by

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
npmpkg:npm/coffeescript@2.7.x
tile.json