Files
xo-stack/packages/wallet/src/storage/storage-memory.ts
T
2024-09-12 21:33:11 +10:00

29 lines
523 B
TypeScript

import { type IStorage } from './interface';
/**
* This exists for testing. It is not intended for actual use and will likely be removed.
*/
export class StorageMemory implements IStorage {
storage: { [key: string]: any } = {};
async start() {}
async stop() {}
async get(key: string) {
return this.storage[key];
}
async set<T>(key: string, value: T) {
this.storage[key] = value;
}
async delete(key: string) {
delete this.storage[key];
}
async clear() {
this.storage = {};
}
}