@fireproof/core 0.10.3-dev → 0.10.4-dev
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/fireproof.browser.esm.js +18886 -0
- package/dist/fireproof.browser.esm.js.map +7 -0
- package/dist/fireproof.browser.js +10 -4
- package/dist/fireproof.browser.js.map +3 -3
- package/dist/fireproof.cjs.js +10 -4
- package/dist/fireproof.cjs.js.map +2 -2
- package/dist/fireproof.esm.js +10 -4
- package/dist/fireproof.esm.js.map +2 -2
- package/package.json +3 -3
- package/src/crdt-helpers.ts +89 -0
- package/src/crdt.ts +45 -0
- package/src/database.ts +61 -0
- package/src/fireproof.ts +6 -0
- package/src/loader-helpers.ts +53 -0
- package/src/loader.ts +66 -0
- package/src/store-browser.ts +78 -0
- package/src/store-fs.ts +51 -0
- package/src/store.ts +32 -0
- package/src/transaction.ts +68 -0
- package/src/types.d.ts +38 -0
@@ -17418,15 +17418,21 @@ You can use close({ resize: true }) to resize header`);
|
|
17418
17418
|
// eslint-disable-next-line @typescript-eslint/require-await
|
17419
17419
|
load(branch = "main") {
|
17420
17420
|
return __async(this, null, function* () {
|
17421
|
-
|
17422
|
-
|
17421
|
+
try {
|
17422
|
+
const bytes = localStorage.getItem(this.headerKey(branch));
|
17423
|
+
return bytes ? this.parseHeader(bytes.toString()) : null;
|
17424
|
+
} catch (e5) {
|
17425
|
+
}
|
17423
17426
|
});
|
17424
17427
|
}
|
17425
17428
|
// eslint-disable-next-line @typescript-eslint/require-await
|
17426
17429
|
save(carCid, branch = "main") {
|
17427
17430
|
return __async(this, null, function* () {
|
17428
|
-
|
17429
|
-
|
17431
|
+
try {
|
17432
|
+
const headerKey = this.headerKey(branch);
|
17433
|
+
return localStorage.setItem(headerKey, this.makeHeader(carCid));
|
17434
|
+
} catch (e5) {
|
17435
|
+
}
|
17430
17436
|
});
|
17431
17437
|
}
|
17432
17438
|
};
|