Browse Source

Implement `has` for storage services (#328)

* Implement `has` for storage services

* Update jslib
pull/329/head
Matt Gibson 5 years ago committed by GitHub
parent
commit
5a377f8ef9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      jslib
  2. 4
      src/services/nodeEnvSecureStorage.service.ts

2
jslib

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

4
src/services/nodeEnvSecureStorage.service.ts

@ -18,6 +18,10 @@ export class NodeEnvSecureStorageService implements StorageService { @@ -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.');

Loading…
Cancel
Save