All Downloads are FREE. Search and download functionalities are using the official Maven repository.

upickle.WebJson.scala Maven / Gradle / Ivy

There is a newer version: 4.0.2
Show newest version
package upickle

import scala.scalajs.js

trait WebJson extends upickle.core.Types {
  object web {
    def read[T: Reader](s: String) = {
      ujson.WebJson.transform(js.JSON.parse(s), implicitly[Reader[T]])
    }

    def write[T: Writer](t: T, indent: Int = -1) = {
      js.JSON.stringify(implicitly[Writer[T]].write(ujson.WebJson.Builder, t))
    }
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy