import utils from "../utils.mjs";
import toFormData from "./toFormData.mjs";
import platform from "../platform/index.mjs";
function toURLEncodedForm(data, options) {
  return toFormData(data, new platform.classes.URLSearchParams(), {
    visitor: function(value, key, path, helpers) {
      if (platform.isNode && utils.isBuffer(value)) {
        this.append(key, value.toString("base64"));
        return false;
      }
      return helpers.defaultVisitor.apply(this, arguments);
    },
    ...options
  });
}
export {
  toURLEncodedForm as default
};
