@@ -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;
|
||||
}
|
||||
>;
|
||||
|
||||
Reference in New Issue
Block a user