@devtron-labs/devtron-fe-common-lib 0.0.47-beta-5 → 0.0.48-beta-3

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
@@ -11753,13 +11753,14 @@ var getFilteredChartVersions = function (charts, selectedChartType) {
11753
11753
  }); });
11754
11754
  };
11755
11755
  function removeEmptyObjectKeysAndNullValues(obj) {
11756
- //it recursively removes empty object keys and array values that are null
11756
+ // It recursively removes empty object keys and array values that are null
11757
11757
  for (var key in obj) {
11758
- if (Array.isArray(obj[key]))
11758
+ if (Array.isArray(obj[key])) {
11759
11759
  obj[key] = obj[key].filter(function (item) { return item !== null; });
11760
- if (obj[key].length === 0) {
11761
11760
  // Check if the array is empty
11762
- delete obj[key]; // Delete the key if the array is empty
11761
+ if (obj[key].length === 0) {
11762
+ delete obj[key]; // Delete the key if the array is empty
11763
+ }
11763
11764
  }
11764
11765
  else if (obj[key] && typeof obj[key] === 'object') {
11765
11766
  if (removeEmptyObjectKeysAndNullValues(obj[key])) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devtron-labs/devtron-fe-common-lib",
3
- "version": "0.0.47-beta-5",
3
+ "version": "0.0.48-beta-3",
4
4
  "description": "Supporting common component library",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -500,12 +500,14 @@ export const getFilteredChartVersions = (charts, selectedChartType) => {
500
500
  }))
501
501
  }
502
502
  function removeEmptyObjectKeysAndNullValues(obj) {
503
- //it recursively removes empty object keys and array values that are null
503
+ // It recursively removes empty object keys and array values that are null
504
504
  for (let key in obj) {
505
- if (Array.isArray(obj[key])) obj[key] = obj[key].filter((item) => item !== null)
506
- if (obj[key].length === 0) {
505
+ if (Array.isArray(obj[key])) {
506
+ obj[key] = obj[key].filter((item) => item !== null)
507
507
  // Check if the array is empty
508
- delete obj[key] // Delete the key if the array is empty
508
+ if (obj[key].length === 0) {
509
+ delete obj[key] // Delete the key if the array is empty
510
+ }
509
511
  } else if (obj[key] && typeof obj[key] === 'object') {
510
512
  if (removeEmptyObjectKeysAndNullValues(obj[key])) {
511
513
  delete obj[key]