Skip to content

Commit 983ae1b

Browse files
authored
Cast runnableEnv items to string
1 parent a0ab61f commit 983ae1b

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

editors/code/src/config.ts

+15-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,21 @@ export class Config {
133133
}
134134

135135
get runnableEnv() {
136-
return this.get<RunnableEnvCfg>("runnableEnv");
136+
const item = this.get<any>("runnableEnv");
137+
if (!item) return item;
138+
const fixRecord = (r: Record<string, any>) => {
139+
for (const key in r) {
140+
if (typeof r[key] !== 'string') {
141+
r[key] = String(r[key]);
142+
}
143+
}
144+
};
145+
if (item instanceof Array) {
146+
item.forEach((x) => fixRecord(x.env));
147+
} else {
148+
fixRecord(item);
149+
}
150+
return item;
137151
}
138152

139153
get restartServerOnConfigChange() {

0 commit comments

Comments
 (0)