Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/sync/apply.ts
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ function isDeepEqual(left: unknown, right: unknown): boolean {
const rightKeys = Object.keys(right as Record<string, unknown>);
if (leftKeys.length !== rightKeys.length) return false;
for (const key of leftKeys) {
if (!Object.hasOwn(right, key)) return false;
if (!hasOwn(right as Record<string, unknown>, key)) return false;
if (
!isDeepEqual(
(left as Record<string, unknown>)[key],
Expand All @@ -298,3 +298,7 @@ function isDeepEqual(left: unknown, right: unknown): boolean {

return false;
}

function hasOwn(target: Record<string, unknown>, key: string): boolean {
return Object.hasOwn(target, key);
}
Comment thread
iHildy marked this conversation as resolved.
Outdated
9 changes: 5 additions & 4 deletions src/sync/mcp-secrets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,6 @@ function isPlainObject(value: unknown): value is Record<string, unknown> {
}

function cloneConfig(config: Record<string, unknown>): Record<string, unknown> {
if (typeof structuredClone === 'function') {
return structuredClone(config);
}
return JSON.parse(JSON.stringify(config)) as Record<string, unknown>;
}

Expand All @@ -136,7 +133,7 @@ export function stripOverrideKeys(
const result: Record<string, unknown> = { ...base };

for (const [key, removeValue] of Object.entries(toRemove)) {
if (!Object.hasOwn(result, key)) continue;
if (!hasOwn(result, key)) continue;
const currentValue = result[key];
if (isPlainObject(removeValue) && isPlainObject(currentValue)) {
const stripped = stripOverrideKeys(
Expand All @@ -160,3 +157,7 @@ export function stripOverrideKeys(
export function hasOverrides(value: Record<string, unknown>): boolean {
return Object.keys(value).length > 0;
}

function hasOwn(target: Record<string, unknown>, key: string): boolean {
return Object.hasOwn(target, key);
}
Comment thread
iHildy marked this conversation as resolved.
Outdated
Loading