@ccci/micro-server 1.0.217 → 1.0.218

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.js CHANGED
@@ -303317,7 +303317,8 @@ class Uploader {
303317
303317
  static async upload(bucket, dir, uploads) {
303318
303318
  try {
303319
303319
  let files = [];
303320
- if (Array.isArray(uploads)) {
303320
+ const isArray = Array.isArray(uploads);
303321
+ if (isArray) {
303321
303322
  files = uploads;
303322
303323
  } else {
303323
303324
  files.push(uploads);
@@ -303338,7 +303339,7 @@ class Uploader {
303338
303339
  mimeType: file.mimetype
303339
303340
  });
303340
303341
  }
303341
- return response4;
303342
+ return isArray ? response4 : response4[0];
303342
303343
  } catch (error) {
303343
303344
  throw error;
303344
303345
  }
@@ -21,7 +21,7 @@ export default class Uploader {
21
21
  * @param uploads {Array<UploadedFile> | UploadedFile} file(s) to be uploaded
22
22
  * @returns
23
23
  */
24
- static upload(bucket: string, dir: string, uploads: Array<UploadedFile> | UploadedFile): Promise<Array<UploadedFileType>>;
24
+ static upload(bucket: string, dir: string, uploads: Array<UploadedFile> | UploadedFile): Promise<Array<UploadedFileType> | UploadedFileType>;
25
25
  /**
26
26
  *
27
27
  * @param bucket {string} bucket name
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ccci/micro-server",
3
- "version": "1.0.217",
3
+ "version": "1.0.218",
4
4
  "module": "index.ts",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",