code: function cleanItem4(value) {
  
          var prevItemKeys = {};
          var alwaysPresent = {};
          var allKeys = {};
  
          if (Array.isArray(value)) {
              value.forEach(function (item) {
  
                  if (item !== null && typeof item === 'object') {
                      Object.keys(item).forEach(function (key) {
                          alwaysPresent[key] = true;
                          allKeys[key] = cleanItem4(item[key]);
                      });
                  }
              });
              value.forEach(function (item) {
                  if (item !== null && typeof item === 'object') {
                      Object.keys(alwaysPresent).forEach(function (key) {
                          if (!(key in item)) {
                              alwaysPresent[key] = false;
                          }
                      });
                  }
              });
              Object.keys(alwaysPresent).forEach(function (key) {
                  if (alwaysPresent[key] && (typeof allKeys[key] == 'string')) {
                      allKeys[key] = allKeys[key] + "!";
                  }
              });
  
              if (Object.keys(allKeys).length > 0) {
                  return [allKeys];
              } else {
                  return value;
              }
  
          }
  
          if ((typeof value !== "object") || (value == null)) {
              return value;
          }
  
          var newValue = {};
  
          Object.keys(value).forEach(function (key) {
              newValue[key] = cleanItem4(value[key]);
          });
          return newValue;
      }
docs: Convert Types