CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-babel--helper-module-imports

Babel helper functions for inserting module loads

Overall
score

99%

Overview
Eval results
Files

task.mdevals/scenario-3/

JavaScript Parser Analyzer

Build a tool that analyzes JavaScript source code by parsing it into an Abstract Syntax Tree (AST) and extracting useful information about the code structure.

Capabilities

Parse JavaScript code

Parse JavaScript source code into an AST representation that can be analyzed.

  • When given valid JavaScript code as a string, the tool should successfully parse it and return the AST @test
  • When given code with modern JavaScript syntax (arrow functions, async/await, optional chaining), it should parse without errors @test
  • When given invalid JavaScript code, it should throw a clear parsing error @test

Extract function information

Analyze parsed code to find all function declarations and their names.

  • When given code containing multiple function declarations, it should return a list of all function names @test

Implementation

@generates

API

/**
 * Parses JavaScript source code and extracts information about function declarations.
 *
 * @param {string} code - The JavaScript source code to analyze
 * @returns {Promise<string[]>} Array of function names found in the code
 * @throws {Error} If the code cannot be parsed
 */
async function analyzeFunctions(code) {
  // IMPLEMENTATION HERE
}

module.exports = {
  analyzeFunctions
};

Dependencies { .dependencies }

@babel/core { .dependency }

Provides JavaScript parsing capabilities for converting code into AST.

@satisfied-by

Install with Tessl CLI

npx tessl i tessl/npm-babel--helper-module-imports

tile.json