MCPcopy Create free account
hub / github.com/microsoft/SandDance / differentObjectValues

Function differentObjectValues

packages/sanddance/src/characterSet.ts:55–71  ·  view source on GitHub ↗
(a: { [key: string]: any }, b: { [key: string]: any })

Source from the content-addressed store, hash-verified

53}
54
55function differentObjectValues(a: { [key: string]: any }, b: { [key: string]: any }) {
56 if (!a && !b) return false;
57 if (!a || !b) return true;
58 const keys = Object.keys(b);
59 for (let i = 0; i < keys.length; i++) {
60 const key = keys[i];
61 const ta = typeof a;
62 const tb = typeof b;
63 if (ta !== tb) return true;
64 if (ta === 'object') {
65 return differentObjectValues(a[key], b[key]);
66 } else {
67 if (a[key] !== b[key]) return true;
68 }
69 }
70 return false;
71}

Callers 1

needsNewCharacterSetFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected