docs: function renameKey(obj, oldKey, newKey) {
      var retObject = {};
      var index, ptr;
  
      if (typeof obj != "object") {
          return retObject;
      }
  
      var oldKeyType = typeof oldKey;
      var newKeyType = typeof newKey;
      if (oldKeyType == "string"
          && newKeyType == "string") {
          for (index in obj) {
              if (obj.hasOwnProperty(index)) {
                  if (index == oldKey) {
                      retObject[newKey] = obj[index];
                  } else {
                      retObject[index] = obj[index];
                  }
              }
          }
      } else if (oldKeyType == "object"
          && newKeyType == "object"
          && oldKey.hasOwnProperty("length")
          && newKey.hasOwnProperty("length")
          && oldKey.length <= newKey.length
          ) {
          for (index in obj) {
              if (obj.hasOwnProperty(index)) {
                  ptr = oldKey.indexOf(index);
                  if (ptr >= 0) {
                      retObject[newKey[ptr]] = obj[index];
                  } else {
                      retObject[index] = obj[index];
                  }
              }
          }
      }
  
      return retObject;
  }