Skip to content

Transform Node to Any #144

Answered by kpodsiad
gilcu2 asked this question in Q&A
Mar 31, 2022 · 2 comments · 1 reply
Discussion options

You must be logged in to vote

Hi @gilcu2!
Which version of lib do you use?

I created some reproduction using scala-cli (I really encourage you to take at look at this tool!)

//> using scala "3.1.1"
//> using lib "org.virtuslab::scala-yaml:0.0.4"
//> using lib "com.lihaoyi::pprint:0.7.3"

import org.virtuslab.yaml.*

object Yaml extends App {
  val node = "1".asNode
  val any = node.map(_.as[Any])
  pprint.log(node)
  pprint.log(any)
}

and it seems like it works. Gist with code is here and you could run it via scala-cli run https://gist.github.com/kpodsiad/d9ee4bfbf7303518dd3959775fe8f6f8 command, provided that you've installed scala-cli.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by gilcu2
Comment options

You must be logged in to vote
1 reply
@gilcu2
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants