From f4879f6607378a7d830bfffdd789dfeb50330ab8 Mon Sep 17 00:00:00 2001 From: "Ethan T. Stanger" Date: Thu, 14 Mar 2024 09:39:03 -0600 Subject: [PATCH] small bugfix --- .../lightningserver/typed/TypescriptSdk.kt | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/server-core/src/main/kotlin/com/lightningkite/lightningserver/typed/TypescriptSdk.kt b/server-core/src/main/kotlin/com/lightningkite/lightningserver/typed/TypescriptSdk.kt index 600885ab..76c043a7 100644 --- a/server-core/src/main/kotlin/com/lightningkite/lightningserver/typed/TypescriptSdk.kt +++ b/server-core/src/main/kotlin/com/lightningkite/lightningserver/typed/TypescriptSdk.kt @@ -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("\",")