I'm trying to export Kotlin functions to Javascript. The problem is, functions which require arguments are renamed after Kotlin2JS operation, here's an example:
Kotlin source:
fun withParam(args: String) {
println("JavaScript generated through Kotlin")
}
fun withoutParams() {
println("Without params")
}
After Kotlin2JS, trying to require in Node REPL:
> const kotlinBundle = require('./build/index.js');
undefined
> kotlinBundle
{ 'withParam_61zpoe$': [Function: withParam],
withoutParams: [Function: withoutParams] }
>
As you can see, function with argument got exported with _61zpoe$ suffix. Is it possible to get rid of that part?
I'm using kotlin2js plugin and kotlin-stdlib-js:1.1.1 library, my kotlinOptions are:
compileKotlin2Js.kotlinOptions {
moduleKind = "commonjs"
outputFile = "build/index.js"
}
Thanks