Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update jsoniter-scala to 2.32.0 and Scala.js to 1.17.0
Browse files Browse the repository at this point in the history
plokhotnyuk committed Jan 2, 2025

Unverified

The email in this signature doesn’t match the committer email.
1 parent 7deb6c3 commit 6abe7b2
Showing 3 changed files with 4 additions and 13 deletions.
13 changes: 2 additions & 11 deletions modules/json/src/smithy4s/json/internals/SchemaVisitorJCodec.scala
Original file line number Diff line number Diff line change
@@ -394,17 +394,8 @@ private[smithy4s] class SchemaVisitorJCodec(
Timestamp(epochSeconds, ((timestamp - epochSeconds) * 1000000000).toInt)
}

def encodeValue(x: Timestamp, out: JsonWriter): Unit = {
// TODO: can be improved with out.writeTimestampVal(x.epochSecond, x.nano) when https://github.com/plokhotnyuk/jsoniter-scala/releases/tag/v2.32.0 is used
out.writeVal(BigDecimal({
val es = java.math.BigDecimal.valueOf(x.epochSecond)
if (x.nano == 0) es
else
es.add(
java.math.BigDecimal.valueOf(x.nano.toLong, 9).stripTrailingZeros
)
}))
}
def encodeValue(x: Timestamp, out: JsonWriter): Unit =
out.writeTimestampVal(x.epochSecond, x.nano)

def decodeKey(in: JsonReader): Timestamp = {
val timestamp = in.readKeyAsBigDecimal()
2 changes: 1 addition & 1 deletion project/Dependencies.scala
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ object Dependencies {

val Jsoniter = new {
val org = "com.github.plokhotnyuk.jsoniter-scala"
val jsoniterScalaVersion = "2.27.6"
val jsoniterScalaVersion = "2.32.0"
val core = Def.setting(org %%% "jsoniter-scala-core" % jsoniterScalaVersion)
val macros = Def.setting(
org %%% "jsoniter-scala-macros" % jsoniterScalaVersion % "compile-internal"
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// format: off
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.12.1")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.16.0")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.17.0")
addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.2.1")
addSbtPlugin("com.github.sbt" % "sbt-dynver" % "5.0.1")
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.10.0")

0 comments on commit 6abe7b2

Please sign in to comment.