adminforth 2.22.0-next.3 → 2.22.0-next.4

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.
@@ -529,20 +529,22 @@ export function compareOldAndNewRecord(oldRecord: Record<string, any>, newRecord
529
529
  const coreStore = useCoreStore();
530
530
 
531
531
  for (const key of newKeys) {
532
- if (oldRecord[key] !== newRecord[key]) {
532
+ const oldValue = typeof oldRecord[key] === 'object' && oldRecord[key] !== null ? JSON.stringify(oldRecord[key]) : oldRecord[key];
533
+ const newValue = typeof newRecord[key] === 'object' && newRecord[key] !== null ? JSON.stringify(newRecord[key]) : newRecord[key];
534
+ if (oldValue !== newValue) {
533
535
  if (
534
536
  (
535
- oldRecord[key] === undefined ||
536
- oldRecord[key] === null ||
537
- oldRecord[key] === '' ||
538
- (Array.isArray(oldRecord[key]) && oldRecord[key].length === 0)
537
+ oldValue === undefined ||
538
+ oldValue === null ||
539
+ oldValue === '' ||
540
+ (Array.isArray(oldValue) && oldValue.length === 0)
539
541
  )
540
542
  &&
541
543
  (
542
- newRecord[key] === undefined ||
543
- newRecord[key] === null ||
544
- newRecord[key] === '' ||
545
- (Array.isArray(newRecord[key]) && newRecord[key].length === 0)
544
+ newValue === undefined ||
545
+ newValue === null ||
546
+ newValue === '' ||
547
+ (Array.isArray(newValue) && newValue.length === 0)
546
548
  )
547
549
  ) {
548
550
  // console.log(`Value for key ${key} is considered equal (empty)`)
@@ -556,7 +558,7 @@ export function compareOldAndNewRecord(oldRecord: Record<string, any>, newRecord
556
558
  continue;
557
559
  }
558
560
  }
559
- // console.log(`Value for key ${key} is different`, { oldValue: oldRecord[key], newValue: newRecord[key] });
561
+ // console.log(`Value for key ${key} is different`, { oldValue: oldValue, newValue: newValue });
560
562
  return false;
561
563
  }
562
564
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adminforth",
3
- "version": "2.22.0-next.3",
3
+ "version": "2.22.0-next.4",
4
4
  "description": "OpenSource Vue3 powered forth-generation admin panel",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",