Fixed envsubst issue (#301)

This commit is contained in:
Louis Lam 2023-12-15 18:08:48 +08:00 committed by GitHub
parent 0f52bb78b8
commit db0add7e4c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -385,7 +385,11 @@ function traverseYAML(pair : Pair, env : DotenvParseOutput) : void {
if (item instanceof Pair) { if (item instanceof Pair) {
traverseYAML(item, env); traverseYAML(item, env);
} else if (item instanceof Scalar) { } else if (item instanceof Scalar) {
item.value = envsubst(item.value, env); let value = item.value as unknown;
if (typeof(value) === "string") {
item.value = envsubst(value, env);
}
} }
} }
// @ts-ignore // @ts-ignore