Skip to content

Commit

Permalink
do not generate Partial Array
Browse files Browse the repository at this point in the history
  • Loading branch information
angryziber committed Feb 16, 2025
1 parent fd7f08e commit d5d5360
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion json/src/TSGenerator.kt
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ open class TSGenerator(
}
var fullType = if (ts[0].isLowerCase()) ts
else ts + (args.takeIf { it.isNotEmpty() }?.joinToString(prefix = "<", postfix = ">") { tsType(it.type) } ?: "")
if (args.firstOrNull()?.type?.jvmErasure?.isSubclassOf(Enum::class) == true) fullType = "Partial<$fullType>"
if (fullType.startsWith("Record") && args.firstOrNull()?.type?.jvmErasure?.isSubclassOf(Enum::class) == true)
fullType = "Partial<$fullType>"
return fullType
}

Expand Down

0 comments on commit d5d5360

Please sign in to comment.