1
0
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:
Thomas Rittson
2021-06-15 14:34:54 -07:00
committed by Thomas Rittson
parent 25fa3e7a2e
commit cdf172f2a1
2 changed files with 8 additions and 0 deletions

View File

@@ -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);

View File

@@ -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);