From 5a377f8ef9ff9612374dfe4203fa5f76502314e2 Mon Sep 17 00:00:00 2001 From: Matt Gibson Date: Tue, 15 Jun 2021 13:41:17 -0500 Subject: [PATCH] Implement `has` for storage services (#328) * Implement `has` for storage services * Update jslib --- jslib | 2 +- src/services/nodeEnvSecureStorage.service.ts | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/jslib b/jslib index fdc6f7b1d2..1f83c3c1ba 160000 --- a/jslib +++ b/jslib @@ -1 +1 @@ -Subproject commit fdc6f7b1d234c72724db47cbea6c94bff7ec0106 +Subproject commit 1f83c3c1ba14d2cdbc319ac060a08cc7c0911b5c diff --git a/src/services/nodeEnvSecureStorage.service.ts b/src/services/nodeEnvSecureStorage.service.ts index 007536a332..f2f0f8d75a 100644 --- a/src/services/nodeEnvSecureStorage.service.ts +++ b/src/services/nodeEnvSecureStorage.service.ts @@ -18,6 +18,10 @@ export class NodeEnvSecureStorageService implements StorageService { return obj as any; } + async has(key: string): Promise { + return await this.get(key) != null; + } + async save(key: string, obj: any): Promise { if (typeof (obj) !== 'string') { throw new Error('Only string storage is allowed.');