@bizy/core 19.5.6 → 19.5.7

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.
@@ -2520,10 +2520,31 @@ class BizyFilterPipe {
2520
2520
  });
2521
2521
  output = output.concat(res);
2522
2522
  });
2523
- let map = new Map();
2524
- output.forEach(obj => map.set(JSON.stringify(obj), obj));
2525
- const uniqueArray = Array.from(map.values());
2526
- return uniqueArray;
2523
+ function deepEqual(a, b, seen = new WeakMap()) {
2524
+ if (a === b)
2525
+ return true;
2526
+ if (typeof a !== "object" || typeof b !== "object" || a === null || b === null)
2527
+ return false;
2528
+ // Circular reference check
2529
+ if (seen.has(a))
2530
+ return seen.get(a) === b;
2531
+ seen.set(a, b);
2532
+ const aKeys = Object.keys(a);
2533
+ const bKeys = Object.keys(b);
2534
+ if (aKeys.length !== bKeys.length)
2535
+ return false;
2536
+ for (let key of aKeys) {
2537
+ if (!bKeys.includes(key))
2538
+ return false;
2539
+ if (!deepEqual(a[key], b[key], seen))
2540
+ return false;
2541
+ }
2542
+ return true;
2543
+ }
2544
+ function uniqueObjects(items) {
2545
+ return items.filter((obj, index, self) => index === self.findIndex(other => deepEqual(obj, other)));
2546
+ }
2547
+ return uniqueObjects(output);
2527
2548
  }
2528
2549
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: BizyFilterPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
2529
2550
  static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.5", ngImport: i0, type: BizyFilterPipe, isStandalone: true, name: "bizyFilter" });