From 7331860e1d0354adc5c95fe2b101a7c47fa87e64 Mon Sep 17 00:00:00 2001 From: Samuel Attard Date: Mon, 31 Oct 2022 17:38:14 -0700 Subject: [PATCH 1/2] fix: do not proxify class instances in forge config --- packages/api/core/src/util/forge-config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/api/core/src/util/forge-config.ts b/packages/api/core/src/util/forge-config.ts index 842a27dd04..9bcbfe24ca 100644 --- a/packages/api/core/src/util/forge-config.ts +++ b/packages/api/core/src/util/forge-config.ts @@ -28,7 +28,7 @@ const proxify = (buildIdentifier: string | (() => strin } for (const [key, val] of Object.entries(proxifiedObject)) { - if (typeof val === 'object' && key !== 'pluginInterface' && !(val instanceof RegExp)) { + if (typeof val === 'object' && val.constructor === Object && key !== 'pluginInterface' && !(val instanceof RegExp)) { (newObject as any)[key] = proxify(buildIdentifier, (proxifiedObject as any)[key], `${envPrefix}_${underscoreCase(key)}`); } else { (newObject as any)[key] = (proxifiedObject as any)[key]; From decccc9040bf3cbb36476600f61557a269f1f1d1 Mon Sep 17 00:00:00 2001 From: Samuel Attard Date: Mon, 31 Oct 2022 17:50:36 -0700 Subject: [PATCH 2/2] spec: fix config tests --- packages/api/core/src/util/forge-config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/api/core/src/util/forge-config.ts b/packages/api/core/src/util/forge-config.ts index 9bcbfe24ca..3f9768b025 100644 --- a/packages/api/core/src/util/forge-config.ts +++ b/packages/api/core/src/util/forge-config.ts @@ -28,7 +28,7 @@ const proxify = (buildIdentifier: string | (() => strin } for (const [key, val] of Object.entries(proxifiedObject)) { - if (typeof val === 'object' && val.constructor === Object && key !== 'pluginInterface' && !(val instanceof RegExp)) { + if (typeof val === 'object' && (val.constructor === Object || val.constructor === Array) && key !== 'pluginInterface' && !(val instanceof RegExp)) { (newObject as any)[key] = proxify(buildIdentifier, (proxifiedObject as any)[key], `${envPrefix}_${underscoreCase(key)}`); } else { (newObject as any)[key] = (proxifiedObject as any)[key];