Move heads() to Node

This commit is contained in:
haad 2016-02-29 12:10:54 +01:00
parent b88c498713
commit 653ce89b55
2 changed files with 4 additions and 4 deletions

View File

@ -13,6 +13,10 @@ class Node {
return "" + this.id + "." + this.seq + "." + this.ver; return "" + this.id + "." + this.seq + "." + this.ver;
} }
get heads() {
return Object.keys(this.next).map((e) => this.next[e]);
}
toJson() { toJson() {
return { id: this.id, seq: this.seq, ver: this.ver, data: this.data, next: this.next } return { id: this.id, seq: this.seq, ver: this.ver, data: this.data, next: this.next }
} }

View File

@ -19,10 +19,6 @@ class OrbitNode extends Node {
return this.hash; return this.hash;
} }
get heads() {
return Object.keys(this.next).map((e) => this.next[e]);
}
compact() { compact() {
let res = { id: this.id, seq: this.seq, ver: this.ver, data: this.data } let res = { id: this.id, seq: this.seq, ver: this.ver, data: this.data }
let items = {}; let items = {};