"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "api/utils/common.js" between
countly-server-20.04.1.4.tar.gz and countly-server-20.04.1.5.tar.gz

About: countly-server is a mobile & web analytics, push notifications and crash reporting platform. This is the server part that collects and analyzes data while individual client SDKs (mobile, web or desktop) send the data. Community Edition (commercial Enterprise Edition also available).

common.js  (countly-server-20.04.1.4):common.js  (countly-server-20.04.1.5)
skipping to change at line 2390 skipping to change at line 2390
ob1[key] = ob2[key]; ob1[key] = ob2[key];
} }
else if (key === "$set" || key === "$setOnInsert" || key === "$unset ") { else if (key === "$set" || key === "$setOnInsert" || key === "$unset ") {
for (let val in ob2[key]) { for (let val in ob2[key]) {
ob1[key][val] = ob2[key][val]; ob1[key][val] = ob2[key][val];
} }
} }
else if (key === "$addToSet") { else if (key === "$addToSet") {
for (let val in ob2[key]) { for (let val in ob2[key]) {
if (typeof ob1[key][val] !== 'object') { if (typeof ob1[key][val] !== 'object') {
ob1[key][val] = {'$each': [ob1[key][val]]}; ob1[key][val] = {'$each': [ob1[key][val]]}; //create as object if it is single value
} }
if (typeof ob2[key][val] === 'object' && ob2[key][val].$each ) { if (typeof ob2[key][val] === 'object' && ob2[key][val].$each ) {
for (let p = 0; p < ob2[key][val].$each.length; p++) { for (let p = 0; p < ob2[key][val].$each.length; p++) {
ob1[key][val].$each.push(ob2[key][val].$each[p]); if (ob1[key][val].$each.indexOf(ob2[key][val].$each[
p]) === -1) {
ob1[key][val].$each.push(ob2[key][val].$each[p])
;
}
} }
} }
else { else {
ob1[key][val].$each.push(ob2[key][val]); if (ob1[key][val].$each.indexOf(ob2[key][val]) === -1) {
ob1[key][val].$each.push(ob2[key][val]);
}
} }
} }
} }
else if (key === "$push") { else if (key === "$push") {
for (let val in ob2[key]) { for (let val in ob2[key]) {
if (typeof ob1[key][val] !== 'object') { if (typeof ob1[key][val] !== 'object') {
ob1[key][val] = {'$each': [ob1[key][val]]}; ob1[key][val] = {'$each': [ob1[key][val]]};
} }
if (typeof ob2[key][val] === 'object' && ob2[key][val].$each ) { if (typeof ob2[key][val] === 'object' && ob2[key][val].$each ) {
for (let p = 0; p < ob2[key][val].$each.length; p++) { for (let p = 0; p < ob2[key][val].$each.length; p++) {
ob1[key][val].$each.push(ob2[key][val].$each[p]); ob1[key][val].$each.push(ob2[key][val].$each[p]);
 End of changes. 4 change blocks. 
3 lines changed or deleted 10 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)