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