Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

refactor: remove duplicate storage

thecodrr0678ee456668
diff --git a/packages/core/__tests__/storage.test.js b/packages/core/__tests__/storage.test.js
index 2940d17ea..449216aac 100644
--- a/packages/core/__tests__/storage.test.js
+++ b/packages/core/__tests__/storage.test.js
@@ -1,5 +1,5 @@
import StorageInterface from "../__mocks__/storage.mock";
-import Storage from "../helpers/storage";
+import Storage from "../database/storage";
const storage = new Storage(StorageInterface);
test("add a value", async () => {
await storage.write("hello", "world");
diff --git a/packages/core/helpers/storage.js b/packages/core/helpers/storage.js
deleted file mode 100644
index b3393c389..000000000
--- a/packages/core/helpers/storage.js
+++ /dev/null
@@ -1,28 +0,0 @@
-import Convert from "../utils/convert";
-
-class Storage {
- constructor(context) {
- this.storage = context;
- }
- async write(key, data) {
- await this.storage.write(key, Convert.toString(data));
- }
- async read(key) {
- let data = await this.storage.read(key);
- return Convert.fromString(data);
- }
- clear() {
- this.storage.clear(); //TODO add test
- }
- remove(key) {
- this.storage.remove(key); //TODO add test
- }
- encrypt(password, data) {
- return this.storage.encrypt(password, data);
- }
- decrypt(password, data) {
- return this.storage.decrypt(password, data);
- }
-}
-
-export default Storage;