mirror of
https://github.com/orbitdb/orbitdb.git
synced 2025-05-22 06:46:38 +00:00
Move heads() to Node
This commit is contained in:
parent
b88c498713
commit
653ce89b55
@ -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 }
|
||||||
}
|
}
|
||||||
|
@ -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 = {};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user