Skip to content

Commit

Permalink
private and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
albertchae committed Nov 7, 2024
1 parent 988a10e commit e4a9771
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion inngest/src/main/kotlin/com/inngest/Function.kt
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ internal open class InternalInngestFunction(
return configBuilder.build(client.appId, serveUrl)
}

fun serializeStepData(stepData: Any?): JsonNode? {
private fun serializeStepData(stepData: Any?): JsonNode? {
if (stepData == null) {
return stepData
}
Expand All @@ -270,6 +270,7 @@ internal open class InternalInngestFunction(
val readOnlyJson = mapper.readTree(jsonString)

if (!readOnlyJson.isObject) {
// primitives can be serialized directly
return readOnlyJson
}

Expand Down
4 changes: 2 additions & 2 deletions inngest/src/main/kotlin/com/inngest/State.kt
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ class State(
return null
}

fun <T> deserializeStepData(serializedStepData: JsonNode?, type: Class<T>): T? {
private fun <T> deserializeStepData(serializedStepData: JsonNode?, type: Class<T>): T? {
val mapper = ObjectMapper()
if (serializedStepData == null || !serializedStepData.isObject || !serializedStepData.has("class")) {
// handles null and primitives
// null and primitives can be deserialized directly
return mapper.treeToValue(serializedStepData, type)
}

Expand Down

0 comments on commit e4a9771

Please sign in to comment.