witheve / Eve

Better tools for thought
http://witheve.com
Apache License 2.0
7.16k stars 257 forks source link

Allow appendAsEAVs to also handle nested sub-records and sub-record sets #861

Closed joshuafcole closed 7 years ago

joshuafcole commented 7 years ago

Let's you write

let eavs = appendAsEAVs([], {tag: "parent", name: "fred", children: [
  {tag: "child", name: "bruce"},
  {tag: "pet", name: "betsy"}
]});

along with the previously supported

let eavs = appendAsEAVs([], {tag: "parent", name: "fred", children: [].concat(
  appendAsEAVs([], {tag: "child", name: "bruce"}),
  appendAsEAVs([], {tag: "pet", name: "betsy"})
)});