Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Kotlin to 1.7.10 #17

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ plugins {
`maven-publish`
signing

kotlin("jvm") version "1.4.32"
id("org.jetbrains.dokka") version "1.4.32"
kotlin("jvm") version "1.7.10"
id("org.jetbrains.dokka") version "1.7.10"

id("net.minecrell.licenser") version "0.4.1"
id("org.jmailen.kotlinter") version "3.3.0"
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/io/outfoxx/typescriptpoet/FileSpec.kt
Original file line number Diff line number Diff line change
Expand Up @@ -344,13 +344,13 @@ private constructor(
fun builder(modulePath: String) = Builder(modulePath)

@JvmStatic
fun get(moduleSpec: ModuleSpec, modulePath: String = moduleSpec.name.replace('.', '/').toLowerCase()): FileSpec =
fun get(moduleSpec: ModuleSpec, modulePath: String = moduleSpec.name.replace('.', '/').lowercase()): FileSpec =
builder(modulePath)
.apply { members.addAll(moduleSpec.members.toMutableList()) }
.build()

@JvmStatic
fun get(typeSpec: AnyTypeSpec, modulePath: String = typeSpec.name.replace('.', '/').toLowerCase()): FileSpec =
fun get(typeSpec: AnyTypeSpec, modulePath: String = typeSpec.name.replace('.', '/').lowercase()): FileSpec =
builder(modulePath)
.addType(typeSpec)
.build()
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/io/outfoxx/typescriptpoet/Modifier.kt
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@ enum class Modifier {
VAR;

val keyword: String
get() = name.toLowerCase()
get() = name.lowercase()
}
2 changes: 1 addition & 1 deletion src/main/java/io/outfoxx/typescriptpoet/NameAllocator.kt
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ private fun toTypeScriptIdentifier(suggestion: String) = buildString {
val validCodePoint: Int = if (Character.isJavaIdentifierPart(codePoint)) {
codePoint
} else {
'_'.toInt()
'_'.code
}
appendCodePoint(validCodePoint)
i += Character.charCount(codePoint)
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/io/outfoxx/typescriptpoet/Utils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ internal fun characterLiteralWithoutDoubleQuotes(c: Char) = when {
c == '\"' -> "\\\"" // \u0022: double quote (")
c == '\'' -> "'" // \u0027: single quote (')
c == '\\' -> "\\\\" // \u005c: backslash (\)
isISOControl(c) -> String.format("\\u%04x", c.toInt())
isISOControl(c) -> String.format("\\u%04x", c.code)
else -> c.toString()
}

Expand Down