mirror of
https://github.com/bitwarden/browser
synced 2025-12-21 10:43:35 +00:00
Implement has for storage services (#328)
* Implement `has` for storage services * Update jslib
This commit is contained in:
2
jslib
2
jslib
Submodule jslib updated: fdc6f7b1d2...1f83c3c1ba
@@ -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.');
|
||||
|
||||
Reference in New Issue
Block a user