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

io.circe.parser.package.scala Maven / Gradle / Ivy

There is a newer version: 0.12.0-M3
Show newest version
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