Skip to content

Commit

Permalink
use the as syntax for types, as strings don't cast to enums by default
Browse files Browse the repository at this point in the history
  • Loading branch information
angryziber committed Feb 16, 2025
1 parent dcccf41 commit c909cbc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion json/src/TSGenerator.kt
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ open class TSGenerator(
val values = cls.objectInstance ?: error("$cls is not an object")
out.println("\n// ${cls.qualifiedName}")
cls.publicProperties.forEach { p ->
out.println("${typePrefix}const ${p.jsonName}: ${tsName(p.returnType.jvmErasure)} = ${mapper.render(p.get(values))}")
out.println("${typePrefix}const ${p.jsonName} = ${mapper.render(p.get(values))} as ${tsType(p.returnType)}")
}
}

Expand Down

0 comments on commit c909cbc

Please sign in to comment.