Auto merge of #13402 - HKalbasi:patch-1, r=Veykril

Cast runnableEnv items to string

fix #13390

An alternative approach could be raising an error if there is non string values.
This commit is contained in:
bors 2022-10-16 09:20:38 +00:00
commit c09151c619

View File

@ -133,7 +133,21 @@ export class Config {
}
get runnableEnv() {
return this.get<RunnableEnvCfg>("runnableEnv");
const item = this.get<any>("runnableEnv");
if (!item) return item;
const fixRecord = (r: Record<string, any>) => {
for (const key in r) {
if (typeof r[key] !== "string") {
r[key] = String(r[key]);
}
}
};
if (item instanceof Array) {
item.forEach((x) => fixRecord(x.env));
} else {
fixRecord(item);
}
return item;
}
get restartServerOnConfigChange() {