diff --git a/src/main.ts b/src/main.ts index f297b7f..3165362 100644 --- a/src/main.ts +++ b/src/main.ts @@ -58,7 +58,7 @@ export class S3Storage implements StorageEngine { } public _handleFile(req: Request, file: EFile, cb: (error?: any, info?: Info) => void) { - const { opts, sharpOpts } = this + const { opts } = this const { mimetype, stream } = file const params = { Bucket: opts.Bucket, @@ -161,7 +161,7 @@ export class S3Storage implements StorageEngine { const upload$ = from( upload.promise().then((result) => { // tslint:disable-next-line - const { Body, ...rest } = size + const { ...rest } = size return { ...result, ...rest, @@ -177,8 +177,8 @@ export class S3Storage implements StorageEngine { const mapArrayToObject: { [k: string]: any } = res.reduce( (acc, curr) => { // tslint:disable-next-line - const { suffix, ContentType, size, format, channels, options, currentSize, ...rest } = curr - acc[curr.suffix] = { + const { suffix, ContentType, currentSize, ...rest } = curr + acc[suffix] = { ACL, ContentDisposition, StorageClass, @@ -228,7 +228,7 @@ export class S3Storage implements StorageEngine { ) .subscribe((result) => { // tslint:disable-next-line - const { size, format, channels, ...rest } = result + const { size, format, ...rest } = result const endRes = { ACL, ContentDisposition, @@ -238,7 +238,7 @@ export class S3Storage implements StorageEngine { ...rest, size: currentSize || size, ContentType: opts.ContentType || format, - mimetype: lookup(result.format) || `image/${result.format}` + mimetype: lookup(format) || `image/${format}` } cb(null, JSON.parse(JSON.stringify(endRes))) }, cb)