diff --git a/package-lock.json b/package-lock.json index cf93d08..4912969 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "react-aws-s3-typescript", - "version": "1.0.2", + "version": "1.1.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 188e797..04cb8d0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-aws-s3-typescript", - "version": "1.0.2", + "version": "1.1.0", "description": "Open source npm package to upload your files into AWS S3 Bucket directly using react(typescript template)", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/src/ErrorThrower.ts b/src/ErrorThrower.ts index 3495fab..b6171f9 100644 --- a/src/ErrorThrower.ts +++ b/src/ErrorThrower.ts @@ -21,4 +21,4 @@ export const throwUploadError = (config: IConfig, file: File) => { if (!file) { throw new Error(`File cannot be empty`); } -} +}; diff --git a/src/react-aws-s3.ts b/src/react-aws-s3.ts index b7ce82e..b086aaf 100644 --- a/src/react-aws-s3.ts +++ b/src/react-aws-s3.ts @@ -93,15 +93,17 @@ class ReactS3Client { }); try { - const req = await s3.listObjects({ - Bucket: this.config.bucketName, - }).promise(); + const req = await s3 + .listObjects({ + Bucket: this.config.bucketName, + }) + .promise(); if (req.$response.error) { return Promise.reject({ err: req.$response.error.name, errMessage: req.$response.error.message, - data: req.$response.error + data: req.$response.error, }); } @@ -109,19 +111,19 @@ class ReactS3Client { return Promise.reject({ err: 'Something went wrong!', errMessage: 'Unknown error occured. Please try again', - data: null + data: null, }); } return Promise.resolve({ message: 'Objects listed succesfully', - data: req.$response.data + data: req.$response.data, }); } catch (err) { return Promise.reject({ err: 'Something went wrong!', errMessage: 'Unknown error occured. Please try again', - data: err + data: err, }); } } diff --git a/src/types.ts b/src/types.ts index 28037c4..e31f129 100644 --- a/src/types.ts +++ b/src/types.ts @@ -49,7 +49,7 @@ export type DeleteResponse = { export type ListFileResponse = { message: string; - data: AWS.S3.ListObjectsOutput + data: AWS.S3.ListObjectsOutput; }; export type ListFileErrorResponse = {