diff --git a/src/memoryStorage.ts b/src/memoryStorage.ts deleted file mode 100644 index 8dde16f..0000000 --- a/src/memoryStorage.ts +++ /dev/null @@ -1,34 +0,0 @@ -type Key = string | symbol; -const cache: Record> = {}; - -class MemoryStorage { - private scope: Key; - data: Record; - - constructor(scope: Key = 'default') { - this.scope = scope; - if (!cache[this.scope]) { - cache[this.scope] = {}; - } - this.data = cache[this.scope]; - } - - getItem(key: string) { - return key in this.data ? this.data[key] : null; - } - - setItem(key: string, value: any) { - this.data[key] = value; - } - - removeItem(key: string) { - delete this.data[key]; - } - - clear() { - cache[this.scope] = {}; - this.data = cache[this.scope]; - } -} - -export default MemoryStorage;