1
0
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:
Matt Gibson
2021-06-15 13:41:17 -05:00
parent d9f6f34a06
commit f41f0e6209
2 changed files with 5 additions and 1 deletions

2
jslib

Submodule jslib updated: fdc6f7b1d2...1f83c3c1ba

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.');