From c3b6fe4ffd42a4bf77f2c7589f11187c560b2606 Mon Sep 17 00:00:00 2001 From: JP Dhabolt Date: Thu, 1 Apr 2021 15:38:10 +0000 Subject: [PATCH] Reduce type noise Signed-off-by: JP Dhabolt --- .../src/lib/transform/include.test.ts | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/packages/config-loader/src/lib/transform/include.test.ts b/packages/config-loader/src/lib/transform/include.test.ts index 750fa0c10b..1746bbcde9 100644 --- a/packages/config-loader/src/lib/transform/include.test.ts +++ b/packages/config-loader/src/lib/transform/include.test.ts @@ -18,6 +18,7 @@ import { JsonValue } from '@backstage/config'; import * as os from 'os'; import { resolve as resolvePath } from 'path'; import { createIncludeTransform } from './include'; +import { TransformFunc } from './types'; const root = os.platform() === 'win32' ? 'C:\\' : '/'; const substituteMe = '${MY_SUBSTITUTION}'; @@ -29,18 +30,7 @@ const env = jest.fn(async (name: string) => { } as { [name: string]: string })[name]; }); -const substitute = async ( - value: JsonValue, -): Promise< - | { - applied: false; - } - | { - applied: true; - value: JsonValue | undefined; - newBaseDir?: string | undefined; - } -> => { +const substitute: TransformFunc = async value => { if (typeof value !== 'string') { return { applied: false }; }