UNPKG

284 BJavaScriptView Raw
1const _ = require('lodash');
2
3function shouldUpdate(a, b, paths) {
4 for (let i = 0; i < paths.length; i++) {
5 const equals = _.isEqual(_.get(a, paths[i]), _.get(b, paths[i]));
6 if (!equals) {
7 return true;
8 }
9 }
10 return false;
11}
12
13module.exports = {
14 shouldUpdate
15};