// @ts-check /** @import { ExtractableFile } from "./isExtractableFile.mjs" */ /** * The default implementation for the class `UploadHttpLink` constructor option * `formDataAppendFile` that uses the standard {@linkcode FormData.append} * method. * @param {FormData} formData Form data to append the specified file to. * @param {string} fieldName Field name for the file. * @param {ExtractableFile} file File to append. */ export default function formDataAppendFile(formData, fieldName, file) { "name" in file ? formData.append(fieldName, file, file.name) : formData.append(fieldName, file); }