(target: T, patch: Partial<T>)
| 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. |
| 3 | export 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 | } |
no test coverage detected