1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-09-14 02:08:50 +02:00

Implement has for storage services (#328)

* Implement `has` for storage services

* Update jslib
This commit is contained in:
Matt Gibson 2021-06-15 13:41:17 -05:00 committed by GitHub
parent d9f6f34a06
commit 5a377f8ef9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

2
jslib

@ -1 +1 @@
Subproject commit fdc6f7b1d234c72724db47cbea6c94bff7ec0106
Subproject commit 1f83c3c1ba14d2cdbc319ac060a08cc7c0911b5c

View File

@ -18,6 +18,10 @@ export class NodeEnvSecureStorageService implements StorageService {
return obj as any;
}
async has(key: string): Promise<boolean> {
return await this.get(key) != null;
}
async save(key: string, obj: any): Promise<any> {
if (typeof (obj) !== 'string') {
throw new Error('Only string storage is allowed.');