From 504dda46a574f3b14fb31e9370d6932d392b9fdc Mon Sep 17 00:00:00 2001 From: allohamora Date: Thu, 7 Sep 2023 10:37:50 +0300 Subject: [PATCH] fix: fix incorrect return types for orThrow methods --- src/env/env.manager.ts | 2 +- src/utils/manager.utils.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/env/env.manager.ts b/src/env/env.manager.ts index 901b931..e6c5c06 100644 --- a/src/env/env.manager.ts +++ b/src/env/env.manager.ts @@ -82,7 +82,7 @@ export class EnvManager(envRecord: EnvRecord): Config[Key] { + public getForOrThrow(envRecord: EnvRecord): NonNullable { const key = this.getKeyOrThrow(envRecord); return this.getOrThrow(key); diff --git a/src/utils/manager.utils.ts b/src/utils/manager.utils.ts index da4e98e..8245dba 100644 --- a/src/utils/manager.utils.ts +++ b/src/utils/manager.utils.ts @@ -13,7 +13,7 @@ export class Manager> { return this.source[key]; } - public getOrThrow(key: Key): Source[Key] { + public getOrThrow(key: Key): NonNullable { const value = this.source[key]; if (value === null || value === undefined) {