Skip to content

Generalize Data annotation #58

Description

@jokade

Case classes annotated with @Data should be translated into plain JS objects when compiled with Scala.js (and be ignored with Scala/JVM).

Example: when Node is defined as

@Data
case class Node(id: Int, label: Option[String] = None, children: Seq[Node] = Nil)

then

Node(1, label = Some("root"), children = Seq(
  Node(2, label = Some("child1")),
  Node(3)
))

should translate to

{id: 1, label: "root", children: [{id: 2, label: "child1", children: []}, {id: 3, label: undefined, children: []}]}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions