summaryrefslogtreecommitdiff
path: root/packages/cli/src/test-utils/mockCommandContext.ts
diff options
context:
space:
mode:
authorHarold Mciver <[email protected]>2025-07-16 22:40:56 -0400
committerGitHub <[email protected]>2025-07-17 02:40:56 +0000
commit9ab44ea9d675cd9d560e22fba50d057f1764f25c (patch)
tree492c12bd893fe0249545a2b4b16a86b11ca86fd1 /packages/cli/src/test-utils/mockCommandContext.ts
parent01e66bb12392c3e8cd0222dc495c8dc61ebe4fba (diff)
updated `/quit` to use new slash command arch (#4259)
Co-authored-by: Abhi <[email protected]>
Diffstat (limited to 'packages/cli/src/test-utils/mockCommandContext.ts')
-rw-r--r--packages/cli/src/test-utils/mockCommandContext.ts10
1 files changed, 4 insertions, 6 deletions
diff --git a/packages/cli/src/test-utils/mockCommandContext.ts b/packages/cli/src/test-utils/mockCommandContext.ts
index 88da4a32..899d5747 100644
--- a/packages/cli/src/test-utils/mockCommandContext.ts
+++ b/packages/cli/src/test-utils/mockCommandContext.ts
@@ -76,15 +76,13 @@ export const createMockCommandContext = (
const targetValue = output[key];
if (
- sourceValue &&
- typeof sourceValue === 'object' &&
- !Array.isArray(sourceValue) &&
- targetValue &&
- typeof targetValue === 'object' &&
- !Array.isArray(targetValue)
+ // We only want to recursivlty merge plain objects
+ Object.prototype.toString.call(sourceValue) === '[object Object]' &&
+ Object.prototype.toString.call(targetValue) === '[object Object]'
) {
output[key] = merge(targetValue, sourceValue);
} else {
+ // If not, we do a direct assignment. This preserves Date objects and others.
output[key] = sourceValue;
}
}