updated /quit to use new slash command arch (#4259)

Co-authored-by: Abhi <abhipatel@google.com>
This commit is contained in:
Harold Mciver
2025-07-16 22:40:56 -04:00
committed by GitHub
parent 01e66bb123
commit 9ab44ea9d6
8 changed files with 120 additions and 99 deletions

View File

@@ -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;
}
}