diff --git a/src/helpers/storage.ts b/src/helpers/storage.ts index a677991..023d808 100644 --- a/src/helpers/storage.ts +++ b/src/helpers/storage.ts @@ -123,7 +123,7 @@ export class Storage { delete(key: string): T { try { let value = this.get(key); - if (value === undefined) { + if (value === null || value === undefined) { throw new ReferenceError(`Key: ${key} not found.`); } const scopedKey = this._scope(key); @@ -150,7 +150,8 @@ export class Storage { */ has(key: string): boolean { this._validateKey(key); - return this.get(key) !== undefined; + let value = this.get(key); + return value !== null && value !== undefined; } /**