Revert changes to types

Signed-off-by: JP Dhabolt <jdhabolt@agero.com>
This commit is contained in:
JP Dhabolt
2021-04-01 15:19:08 +00:00
parent 0efa7ae6a7
commit dbbb8f7b37
2 changed files with 20 additions and 6 deletions
@@ -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 };
}
@@ -23,8 +23,13 @@ export type ReadFileFunc = (path: string) => Promise<string>;
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;
}
>;