Skip to content

Instantly share code, notes, and snippets.

@emlynoregan
Created September 17, 2016 12:59
Show Gist options
  • Save emlynoregan/d3488c0efc48b1a845aabea0fa2f86de to your computer and use it in GitHub Desktop.
Save emlynoregan/d3488c0efc48b1a845aabea0fa2f86de to your computer and use it in GitHub Desktop.
{
"requires": [
"getmodelnodebyid",
"coalesce"
],
"transform-t": {
"!": {
":": {
"!": {
":": {
"true": {
":": [
"^%",
{
"accum": {
"found": null,
"prev": null,
"curr": null
},
"list": "^@.parent.children",
"t": {
":": {
"found": {
"list": [
"^@.accum.found",
{
"true": {
":": "^@.accum.prev"
},
"cond": {
":": [
"&=",
"^@.item.id",
"^@.id"
]
},
"&": "if"
}
],
"&": "coalesce"
},
"prev": "^@.item"
}
},
"&": "reduce"
},
"found"
]
},
"false": {
"this": "^@.this",
"id": "^@.id",
"parent": "^@.parent"
},
"cond": {
":": "^@.parent"
},
"&": "if"
}
},
"parent": {
"id": "^@.this.parent",
"&": "getmodelnodebyid"
}
}
},
"this": {
"&": "getmodelnodebyid"
}
},
"name": "getpreviousmodelnodebyid_model_studio_emlynoregan_com",
"language": "sUTL0"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment