tango-app-api-client 3.4.0-beta.0 → 3.4.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tango-app-api-client",
3
- "version": "3.4.0-beta.0",
3
+ "version": "3.4.0-beta.1",
4
4
  "description": "client",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -2674,16 +2674,24 @@ export async function getActivityLogs( req, res ) {
2674
2674
  }
2675
2675
  }
2676
2676
 
2677
- function findDifferences( obj1, obj2 ) {
2678
- let differences = {};
2679
-
2680
- for ( let key in obj1 ) {
2681
- if ( obj1[key] !== obj2[key] ) {
2682
- differences[splitCamelCase( key )] = { previous: obj1[key], current: obj2[key] };
2677
+ function findDifferences( oldData, newData ) {
2678
+ const allKeys = new Set( [ ...Object.keys( oldData ), ...Object.keys( newData ) ] );
2679
+ const diff = {};
2680
+
2681
+ allKeys.forEach( ( key ) => {
2682
+ const previous = key in oldData ? oldData[key] : null;
2683
+ const current = key in newData ? newData[key] : null;
2684
+
2685
+ // Only include fields that are added or updated (where previous !== current)
2686
+ if ( previous !== current ) {
2687
+ diff[splitCamelCase( key )] = {
2688
+ previous,
2689
+ current,
2690
+ };
2683
2691
  }
2684
- }
2692
+ } );
2685
2693
 
2686
- return differences;
2694
+ return diff;
2687
2695
  }
2688
2696
 
2689
2697
  function splitCamelCase( text ) {