Skip to content

Commit b3c2dad

Browse files
committed
fix lint
1 parent 82bef30 commit b3c2dad

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

index.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,9 @@ class S3Adapter {
8989
accessKeyId: options.accessKey,
9090
secretAccessKey: options.secretKey,
9191
};
92-
} else if (options.credentials) s3Options.credentials = options.credentials;
92+
} else if (options.credentials) {
93+
s3Options.credentials = options.credentials;
94+
}
9395

9496
if (options.accessKey && options.secretKey) {
9597
awsCredentialsDeprecationNotice();
@@ -104,14 +106,14 @@ class S3Adapter {
104106
}
105107

106108
async createBucket() {
107-
if (this._hasBucket) return;
109+
if (this._hasBucket) { return; }
108110

109111
try {
110112
await this._s3Client.send(new CreateBucketCommand({ Bucket: this._bucket }));
111113
this._hasBucket = true;
112114
} catch (error) {
113-
if (error.name === 'BucketAlreadyOwnedByYou') this._hasBucket = true;
114-
else throw error;
115+
if (error.name === 'BucketAlreadyOwnedByYou') { this._hasBucket = true; }
116+
else { throw error; }
115117
}
116118
}
117119

@@ -181,7 +183,7 @@ class S3Adapter {
181183
await this.createBucket();
182184
const command = new GetObjectCommand(params);
183185
const response = await this._s3Client.send(command);
184-
if (response && !response.Body) throw new Error(response);
186+
if (response && !response.Body) { throw new Error(response); }
185187

186188
const buffer = await responseToBuffer(response);
187189
return buffer;
@@ -234,7 +236,7 @@ class S3Adapter {
234236
await this.createBucket();
235237
const command = new GetObjectCommand(params);
236238
const data = await this._s3Client.send(command);
237-
if (data && !data.Body) throw new Error('S3 object body is missing.');
239+
if (data && !data.Body) { throw new Error('S3 object body is missing.'); }
238240

239241
res.writeHead(206, {
240242
'Accept-Ranges': data.AcceptRanges,

0 commit comments

Comments
 (0)