@devtron-labs/devtron-fe-common-lib 0.0.48-beta-3 → 0.0.48-beta-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.
package/dist/index.js CHANGED
@@ -11756,6 +11756,8 @@ function removeEmptyObjectKeysAndNullValues(obj) {
11756
11756
  // It recursively removes empty object keys and array values that are null
11757
11757
  for (var key in obj) {
11758
11758
  if (Array.isArray(obj[key])) {
11759
+ if (obj[key].length === 0)
11760
+ continue;
11759
11761
  obj[key] = obj[key].filter(function (item) { return item !== null; });
11760
11762
  // Check if the array is empty
11761
11763
  if (obj[key].length === 0) {
@@ -11767,7 +11769,7 @@ function removeEmptyObjectKeysAndNullValues(obj) {
11767
11769
  delete obj[key];
11768
11770
  }
11769
11771
  }
11770
- else if (obj[key] === null || obj[key] === undefined) {
11772
+ else if (obj[key] === undefined) {
11771
11773
  delete obj[key];
11772
11774
  }
11773
11775
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devtron-labs/devtron-fe-common-lib",
3
- "version": "0.0.48-beta-3",
3
+ "version": "0.0.48-beta-4",
4
4
  "description": "Supporting common component library",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -503,6 +503,7 @@ function removeEmptyObjectKeysAndNullValues(obj) {
503
503
  // It recursively removes empty object keys and array values that are null
504
504
  for (let key in obj) {
505
505
  if (Array.isArray(obj[key])) {
506
+ if (obj[key].length === 0) continue
506
507
  obj[key] = obj[key].filter((item) => item !== null)
507
508
  // Check if the array is empty
508
509
  if (obj[key].length === 0) {
@@ -512,7 +513,7 @@ function removeEmptyObjectKeysAndNullValues(obj) {
512
513
  if (removeEmptyObjectKeysAndNullValues(obj[key])) {
513
514
  delete obj[key]
514
515
  }
515
- } else if (obj[key] === null || obj[key] === undefined) {
516
+ } else if (obj[key] === undefined) {
516
517
  delete obj[key]
517
518
  }
518
519
  }