walkObject = function(object) {
    if (!goog.isObject(object)) return object;
    const ret = Array.isArray(object) ? [] : {};
    const isNode = object instanceof Object.getPrototypeOf(ee.api.ValueNode);
    const valueTable = isNode ? object.Serializable$values : object;
    for (const [key, val] of Object.entries(valueTable)) {
      if (!isNode) {
        ret[key] = walkObject(val);  // Always walk literal objects.
      } else if (val === null) {
        continue;  // Serializable always skips null values.
      } else if (key === 'functionDefinitionValue' && val.body != null) {
        ret[key] = {
          'argumentNames': val.argumentNames,
          'body': walkObject(values[val.body])
        };
      } else if (
          key === 'functionInvocationValue' && val.functionReference != null) {
        ret[key] = {
          'arguments': goog.object.map(val.arguments, walkObject),
          'functionReference': walkObject(values[val.functionReference])
        };
      } else if (key === 'constantValue') {
        // Do not recurse into constants.
        ret[key] = val === ee.apiclient.NULL_VALUE ? null : val;
      } else {
        ret[key] = walkObject(val);  // Walk other ValueNode subtrees.
      }
    }
    return ret;
  }
Serializes an object to a "pretty" JSON representation, in Cloud API format.
@param {*} obj The object to Serialize.
@return {*} A JSON-compatible structure representing the input.
@export
@suppress {missingProperties} object.Serializable$values