mirror of
https://github.com/bitwarden/browser.git
synced 2024-12-28 17:27:50 +01:00
Update storageService implementations (#1033)
* Add htmlStorageService.has * Add memoryStorageService.has
This commit is contained in:
parent
7c64c812fc
commit
44bf90cf6a
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user