MCPcopy Create free account
hub / github.com/GCWing/BitFun / shallowEqual

Function shallowEqual

src/web-ui/src/tools/git/hooks/useGitState.ts:337–352  ·  view source on GitHub ↗
(a: any, b: any)

Source from the content-addressed store, hash-verified

335}
336
337function shallowEqual(a: any, b: any): boolean {
338 if (a === b) return true;
339 if (a == null || b == null) return false;
340 if (typeof a !== 'object' || typeof b !== 'object') return a === b;
341
342 const keysA = Object.keys(a);
343 const keysB = Object.keys(b);
344
345 if (keysA.length !== keysB.length) return false;
346
347 for (const key of keysA) {
348 if (a[key] !== b[key]) return false;
349 }
350
351 return true;
352}

Callers 1

useGitStateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected