fun translate()

in src/main/kotlin/com/compiler/server/controllers/CompilerRestController.kt [131:141]


    fun translate(
        @RequestBody @Valid project: Project,
        @RequestParam(defaultValue = "js") compiler: String,
        @RequestParam(defaultValue = "false") debugInfo: Boolean
    ): TranslationResultWithJsCode {
        return when (KotlinTranslatableCompiler.valueOf(compiler.uppercase().replace("-", "_"))) {
            KotlinTranslatableCompiler.JS -> kotlinProjectExecutor.convertToJsIr(project)
            KotlinTranslatableCompiler.WASM -> kotlinProjectExecutor.convertToWasm(project, debugInfo)
            KotlinTranslatableCompiler.COMPOSE_WASM -> kotlinProjectExecutor.convertToWasm(project, debugInfo)
        }
    }