@fireproof/core 0.5.4 → 0.5.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/dist/src/fireproof.mjs
CHANGED
@@ -37993,6 +37993,7 @@ function localSet (key, value) {
|
|
37993
37993
|
}
|
37994
37994
|
|
37995
37995
|
// @ts-nocheck
|
37996
|
+
const parseCID = cid => (typeof cid === 'string' ? CID$1.parse(cid) : cid);
|
37996
37997
|
|
37997
37998
|
/**
|
37998
37999
|
* @class Fireproof
|
@@ -38896,8 +38897,6 @@ async function doIndexQuery (blocks, indexByKey, query = {}) {
|
|
38896
38897
|
}
|
38897
38898
|
}
|
38898
38899
|
|
38899
|
-
const parseCID = cid => (typeof cid === 'string' ? CID$1.parse(cid) : cid);
|
38900
|
-
|
38901
38900
|
class Fireproof {
|
38902
38901
|
/**
|
38903
38902
|
* @function storage
|
@@ -38981,7 +38980,7 @@ class Fireproof {
|
|
38981
38980
|
const allCIDs = await database.allCIDs();
|
38982
38981
|
const blocks = database.blocks;
|
38983
38982
|
|
38984
|
-
const rootCid =
|
38983
|
+
const rootCid = parseCID(allCIDs[allCIDs.length - 1]);
|
38985
38984
|
if (typeof key === 'undefined') {
|
38986
38985
|
key = blocks.valet?.getKeyMaterial();
|
38987
38986
|
}
|
@@ -38999,7 +38998,9 @@ class Fireproof {
|
|
38999
38998
|
allCIDs.map(async c => {
|
39000
38999
|
const b = await blocks.get(c);
|
39001
39000
|
// console.log('block', b)
|
39002
|
-
if (typeof b.cid === 'string') {
|
39001
|
+
if (typeof b.cid === 'string') {
|
39002
|
+
b.cid = parseCID(b.cid);
|
39003
|
+
}
|
39003
39004
|
// if (b.bytes.constructor.name === 'Buffer') console.log('conver vbuff')
|
39004
39005
|
return b
|
39005
39006
|
})
|