docs: async function toWireValue(obj) {
    let value = await Promise.resolve(obj);
    if (value === void 0 || value === null) {
      return value;
    }
  
    if (typeof value === 'boolean'
        || typeof value === 'number'
        || typeof value === 'string') {
      return value;
    }
  
    if (Array.isArray(value)) {
      return convertKeys(value);
    }
  
    if (typeof value === 'function') {
      return '' + value;
    }
  
    if (typeof value[Symbols.serialize] === 'function') {
      return toWireValue(value[Symbols.serialize]());
    } else if (typeof value.toJSON === 'function') {
      return toWireValue(value.toJSON());
    }
    return convertKeys(value);
  }