mirror of
https://github.com/bitwarden/web
synced 2025-12-06 00:03:28 +00:00
Update storageService implementations (#1033)
* Add htmlStorageService.has * Add memoryStorageService.has
This commit is contained in:
committed by
Thomas Rittson
parent
25fa3e7a2e
commit
cdf172f2a1
@@ -44,6 +44,10 @@ export class HtmlStorageService implements StorageService {
|
||||
return Promise.resolve(null);
|
||||
}
|
||||
|
||||
async has(key: string): Promise<boolean> {
|
||||
return this.get(key) != null;
|
||||
}
|
||||
|
||||
save(key: string, obj: any): Promise<any> {
|
||||
if (obj == null) {
|
||||
return this.remove(key);
|
||||
|
||||
@@ -11,6 +11,10 @@ export class MemoryStorageService implements StorageService {
|
||||
return Promise.resolve(null);
|
||||
}
|
||||
|
||||
async has(key: string): Promise<boolean> {
|
||||
return this.get(key) != null;
|
||||
}
|
||||
|
||||
save(key: string, obj: any): Promise<any> {
|
||||
if (obj == null) {
|
||||
return this.remove(key);
|
||||
|
||||
Reference in New Issue
Block a user