From 983ae1b1c9b54bb82c5c7e90e98725d283d0889b Mon Sep 17 00:00:00 2001 From: HKalbasi <45197576+HKalbasi@users.noreply.github.com> Date: Wed, 12 Oct 2022 20:40:49 +0330 Subject: [PATCH 1/2] Cast runnableEnv items to string --- editors/code/src/config.ts | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/editors/code/src/config.ts b/editors/code/src/config.ts index a9c0f079b3d..d66aa52fadc 100644 --- a/editors/code/src/config.ts +++ b/editors/code/src/config.ts @@ -133,7 +133,21 @@ export class Config { } get runnableEnv() { - return this.get("runnableEnv"); + const item = this.get("runnableEnv"); + if (!item) return item; + const fixRecord = (r: Record) => { + 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() { From 58e5452a9bd6adef56e7099b21862985c4c0151c Mon Sep 17 00:00:00 2001 From: HKalbasi <45197576+HKalbasi@users.noreply.github.com> Date: Wed, 12 Oct 2022 14:14:59 -0700 Subject: [PATCH 2/2] fix formatting --- editors/code/src/config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/editors/code/src/config.ts b/editors/code/src/config.ts index d66aa52fadc..15846a5e864 100644 --- a/editors/code/src/config.ts +++ b/editors/code/src/config.ts @@ -137,7 +137,7 @@ export class Config { if (!item) return item; const fixRecord = (r: Record) => { for (const key in r) { - if (typeof r[key] !== 'string') { + if (typeof r[key] !== "string") { r[key] = String(r[key]); } }