(objA, objB, ingoreKey)
| 7 | } |
| 8 | |
| 9 | const shallowEqual = (objA, objB, ingoreKey) => { |
| 10 | if (objA === objB) { |
| 11 | return true |
| 12 | } |
| 13 | if((objA == undefined && objB != undefined) || (objB == undefined && objA != undefined) |
| 14 | || (objA == null && objB != null) || (objB == null && objA != null)) { |
| 15 | return false |
| 16 | } |
| 17 | |
| 18 | const keysA = Object.keys(objA) |
| 19 | const keysB = Object.keys(objB) |
| 20 | |
| 21 | if (keysA.length !== keysB.length) { |
| 22 | return false |
| 23 | } |
| 24 | // Test for A's keys different from B. |
| 25 | const hasOwn = Object.prototype.hasOwnProperty |
| 26 | for (let i = 0; i < keysA.length; i++) { |
| 27 | if (!hasOwn.call(objB, keysA[i]) || |
| 28 | (keysA[i] != ingoreKey && objA[keysA[i]] !== objB[keysA[i]])) { |
| 29 | return false |
| 30 | } |
| 31 | } |
| 32 | return true |
| 33 | } |
| 34 | |
| 35 | const wrap_component = (WrappedComponent, tag, defaultMapper) => { |
| 36 | const app = window.__app__ |
no outgoing calls
no test coverage detected