29 lines
523 B
TypeScript
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 = {};
|
|
}
|
|
}
|