From dbbb8f7b37e496f2a00ad28526db3b9e27e1e240 Mon Sep 17 00:00:00 2001 From: JP Dhabolt Date: Thu, 1 Apr 2021 15:19:08 +0000 Subject: [PATCH] Revert changes to types Signed-off-by: JP Dhabolt --- .../src/lib/transform/include.test.ts | 11 ++++++++++- packages/config-loader/src/lib/transform/types.ts | 15 ++++++++++----- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/packages/config-loader/src/lib/transform/include.test.ts b/packages/config-loader/src/lib/transform/include.test.ts index 12f59feb84..750fa0c10b 100644 --- a/packages/config-loader/src/lib/transform/include.test.ts +++ b/packages/config-loader/src/lib/transform/include.test.ts @@ -31,7 +31,16 @@ const env = jest.fn(async (name: string) => { const substitute = async ( value: JsonValue, -): Promise<{ applied: boolean; value?: JsonValue }> => { +): Promise< + | { + applied: false; + } + | { + applied: true; + value: JsonValue | undefined; + newBaseDir?: string | undefined; + } +> => { if (typeof value !== 'string') { return { applied: false }; } diff --git a/packages/config-loader/src/lib/transform/types.ts b/packages/config-loader/src/lib/transform/types.ts index e7ebb0fddc..c13f01d016 100644 --- a/packages/config-loader/src/lib/transform/types.ts +++ b/packages/config-loader/src/lib/transform/types.ts @@ -23,8 +23,13 @@ export type ReadFileFunc = (path: string) => Promise; export type TransformFunc = ( value: JsonValue, baseDir: string, -) => Promise<{ - applied: boolean; - value?: JsonValue; - newBaseDir?: string; -}>; +) => Promise< + | { + applied: false; + } + | { + applied: true; + value: JsonValue | undefined; + newBaseDir?: string | undefined; + } +>;