Skip to content

Commit

Permalink
small bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
Ethan T. Stanger committed Mar 14, 2024
1 parent 6215599 commit f4879f6
Showing 1 changed file with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,10 @@ fun Documentable.Companion.typescriptSdk(out: Appendable) = with(out) {
appendLine(" {")
for (index in 0 until it.descriptor.elementsCount) {
append(" ")
append(
it.descriptor.getElementName(index).first()
.let { char -> if (char.isJavaIdentifierStart()) char else '_' })
append(
it.descriptor.getElementName(index).drop(1)
.map { char -> if (char.isJavaIdentifierPart()) char else '_' }.joinToString()
)
it.descriptor.getElementName(index).first()
.let { if (it.isJavaIdentifierStart()) it else '_' }.let { append(it) }
it.descriptor.getElementName(index).drop(1)
.map { if (it.isJavaIdentifierPart()) it else '_' }.forEach { append(it) }
append(" = \"")
append(it.descriptor.getElementName(index))
append("\",")
Expand Down

0 comments on commit f4879f6

Please sign in to comment.