(a: { [key: string]: any }, b: { [key: string]: any })
| 53 | } |
| 54 | |
| 55 | function 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 | } |
no outgoing calls
no test coverage detected