io.circe.parser.package.scala Maven / Gradle / Ivy
package io.circe
import cats.data.Xor
import io.circe.scalajs.convertJsToJson
import scala.scalajs.js.JSON
package object parser extends Parser {
def parse(input: String): Xor[ParsingFailure, Json] =
Xor.catchNonFatal(JSON.parse(input)).flatMap(convertJsToJson).leftMap(exception =>
ParsingFailure(exception.getMessage, exception)
)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy