mirror of
https://github.com/bitwarden/cli
synced 2025-12-10 05:13:54 +00:00
Implement has for storage services (#328)
* Implement `has` for storage services
* Update jslib
(cherry picked from commit 5a377f8ef9)
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