bundlebee 1.0.4 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +17 -4
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -163,6 +163,23 @@ module.exports = class Bundlebee extends ReadyResource {
|
|
|
163
163
|
}
|
|
164
164
|
}
|
|
165
165
|
|
|
166
|
+
async *allABIs() {
|
|
167
|
+
for await (const d of this._bee.createChangesStream()) {
|
|
168
|
+
let record = null
|
|
169
|
+
for (const b of d.batch) {
|
|
170
|
+
if (!b.keys) continue
|
|
171
|
+
const r = b.keys.find((k) => k.key.toString() === MANIFEST_KEY_VALUE)
|
|
172
|
+
if (!r) continue
|
|
173
|
+
record = r
|
|
174
|
+
}
|
|
175
|
+
if (!record) continue
|
|
176
|
+
|
|
177
|
+
const manifest = c.decode(Manifest, record.value)
|
|
178
|
+
|
|
179
|
+
yield { checkout: d.head, manifest }
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
166
183
|
async checkout(checkout) {
|
|
167
184
|
if (!this.opened) await this.ready()
|
|
168
185
|
|
|
@@ -287,10 +304,6 @@ module.exports = class Bundlebee extends ReadyResource {
|
|
|
287
304
|
|
|
288
305
|
const w = this._bee.write()
|
|
289
306
|
|
|
290
|
-
// for await (const { key } of this._bee.createReadStream()) {
|
|
291
|
-
// w.tryDelete(key)
|
|
292
|
-
// }
|
|
293
|
-
|
|
294
307
|
for (const f in data.bundle.files) {
|
|
295
308
|
w.tryPut(
|
|
296
309
|
b4a.from(f),
|