Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import io.circe._
- import io.circe.syntax._
- def mapStrings(json: Json)(f: String => String): Json = json.fold(
- json, // null
- _ => json, // boolean
- _ => json, // number
- str => f(str).asJson,
- arr => arr.map(mapStrings(_)(f)).asJson,
- obj => obj.mapValues(mapStrings(_)(f)).asJson
- )
Add Comment
Please, Sign In to add comment