@captainsafia/burrow 1.0.0-preview.0a24dbc → 1.0.0-preview.d773ac0
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/api.js +3 -2
- package/package.json +1 -1
package/dist/api.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/storage/index.ts
|
|
2
|
-
import { mkdir, rename,
|
|
2
|
+
import { mkdir, rename, unlink } from "node:fs/promises";
|
|
3
3
|
import { join as join2 } from "node:path";
|
|
4
4
|
import { randomBytes } from "node:crypto";
|
|
5
5
|
|
|
@@ -65,7 +65,8 @@ class Storage {
|
|
|
65
65
|
}
|
|
66
66
|
async read() {
|
|
67
67
|
try {
|
|
68
|
-
const
|
|
68
|
+
const file = Bun.file(this.storePath);
|
|
69
|
+
const content = await file.text();
|
|
69
70
|
const store = JSON.parse(content);
|
|
70
71
|
if (store.version !== STORE_VERSION) {
|
|
71
72
|
throw new Error(`Unsupported store version: ${store.version}. Expected: ${STORE_VERSION}`);
|