wavespeed 0.0.10 → 0.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -0
- package/dist/index.js +9 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -238,11 +238,19 @@ class WaveSpeed {
|
|
|
238
238
|
*/
|
|
239
239
|
async upload(file, options) {
|
|
240
240
|
const form = new FormData();
|
|
241
|
-
|
|
241
|
+
if (options === null || options === void 0 ? void 0 : options.filename) {
|
|
242
|
+
form.append('file', file, options.filename);
|
|
243
|
+
}
|
|
244
|
+
else {
|
|
245
|
+
form.append('file', file);
|
|
246
|
+
}
|
|
242
247
|
// Only set Authorization header; browser will set Content-Type
|
|
243
248
|
if (options == null) {
|
|
244
249
|
options = { isUpload: true };
|
|
245
250
|
}
|
|
251
|
+
else {
|
|
252
|
+
options.isUpload = true;
|
|
253
|
+
}
|
|
246
254
|
const response = await this.fetchWithTimeout('media/upload/binary', {
|
|
247
255
|
method: 'POST',
|
|
248
256
|
body: form,
|