(obj1, obj2)
| 154 | } |
| 155 | |
| 156 | function difference(obj1, obj2) { |
| 157 | const diff = Object.keys(obj1).reduce((result, key) => { |
| 158 | if (!Object.prototype.hasOwnProperty.call(obj2, key)) { |
| 159 | result.push(key) |
| 160 | } else if (_.isEqual(obj1[key], obj2[key])) { |
| 161 | const resultKeyIndex = result.indexOf(key) |
| 162 | result.splice(resultKeyIndex, 1) |
| 163 | } |
| 164 | return result |
| 165 | }, Object.keys(obj2)) |
| 166 | |
| 167 | return diff |
| 168 | } |
no outgoing calls
no test coverage detected