hypercore-list 0.0.1-alpha.1 → 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- package/index.js +5 -2
- package/package.json +1 -1
package/index.js
CHANGED
@@ -32,12 +32,15 @@ class HypercoreList {
|
|
32
32
|
return this._getWithWaiting('TITLE', this.titleEncs)
|
33
33
|
}
|
34
34
|
|
35
|
-
async setEntries (orderedEntries) {
|
35
|
+
async setEntries (orderedEntries, { description } = {}) {
|
36
|
+
if (!description) description = `List entry for ${idEnc.normalize(this.bee.key)}`
|
37
|
+
|
38
|
+
if (!this.bee.opened) await this.bee.ready()
|
36
39
|
const bufferEntries = []
|
37
40
|
const rehosterEntries = new Map()
|
38
41
|
for (const key of orderedEntries) {
|
39
42
|
bufferEntries.push(idEnc.decode(key))
|
40
|
-
rehosterEntries.set(key, {})
|
43
|
+
rehosterEntries.set(key, { description })
|
41
44
|
}
|
42
45
|
|
43
46
|
let inserted = true
|