groupskns.js
435 Bytes
const skns = require('../data/skns.json');
const newskns = require('./addskns.json');
const _ = require('lodash');
const addskns = [];
_.forEach(newskns, skn => {
const find = _.find(skns, s => s.yhId === skn.yhId);
if (find) {
if (find.productId !== skn.productId) {
find.productId = skn.productId;
console.log('change', find)
}
} else {
addskns.push(skn);
}
});
console.log(JSON.stringify(addskns))