MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / hasPatchChanges

Function hasPatchChanges

apps/kimi-code/src/tui/utils/object-patch.ts:3–8  ·  view source on GitHub ↗
(target: T, patch: Partial<T>)

Source from the content-addressed store, hash-verified

1// Returns true when applying `patch` would change at least one own property.
2// Used before UI refresh paths so repeated equivalent state patches are cheap.
3export function hasPatchChanges<T extends object>(target: T, patch: Partial<T>): boolean {
4 for (const key of Object.keys(patch) as Array<keyof T>) {
5 if (!Object.is(target[key], patch[key])) return true;
6 }
7 return false;
8}

Callers 2

setAppStateMethod · 0.90
patchLivePaneMethod · 0.90

Calls 1

keysMethod · 0.80

Tested by

no test coverage detected