docs
evals
scenario-1
scenario-10
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
Build a tool that analyzes transpiled JavaScript modules to detect and identify star re-export patterns.
When TypeScript and Babel transpilers convert ESM star re-exports (export * from 'module') to CommonJS, they generate distinctive code patterns. Your task is to build an analyzer that detects these patterns and classifies which transpiler generated them.
{ detected: true, transpiler: 'babel' } @test{ detected: true, transpiler: 'typescript' } @test{ detected: false, transpiler: null } @test/**
* Analyzes transpiled CommonJS code to detect star re-export patterns
* @param {string} source - JavaScript source code to analyze
* @returns {Object} Analysis result with detected (boolean) and transpiler (string|null) properties
*/
function analyzeTranspiledModule(source) {
// Implementation here
}
module.exports = { analyzeTranspiledModule };Provides CommonJS module lexing and export detection capabilities.