Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
trim21 committed Nov 5, 2023
1 parent f3d6e2a commit 6b78c87
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions src/internal/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -798,8 +798,9 @@ export class TypedClient {

/**
* Creates the bucket `bucketName`.
* */
async makeBucket(bucketName: string, region?: Region, makeOpts: MakeBucketOpt = {}): Promise<void> {
*
*/
async makeBucket(bucketName: string, region: Region = '', makeOpts: MakeBucketOpt = {}): Promise<void> {
if (!isValidBucketName(bucketName)) {
throw new errors.InvalidBucketNameError('Invalid bucket name: ' + bucketName)
}
Expand Down Expand Up @@ -828,17 +829,11 @@ export class TypedClient {
// sending makeBucket request with XML containing 'us-east-1' fails. For
// default region server expects the request without body
if (region && region !== DEFAULT_REGION) {
const createBucketConfiguration: Array<any> = []
createBucketConfiguration.push({
_attr: {
xmlns: 'http://s3.amazonaws.com/doc/2006-03-01/',
},
})
createBucketConfiguration.push({
LocationConstraint: region,
})
const payloadObject = {
CreateBucketConfiguration: createBucketConfiguration,
CreateBucketConfiguration: [
{ _attr: { xmlns: 'http://s3.amazonaws.com/doc/2006-03-01/' } },
{ LocationConstraint: region },
],
}
payload = Xml(payloadObject)
}
Expand Down Expand Up @@ -1310,6 +1305,7 @@ export class TypedClient {
headers['Content-MD5'] = toMd5(payload)
await this.makeRequestAsyncOmit({ method, bucketName, objectName, query, headers }, payload, [200, 204])
}

getObjectLockConfig(bucketName: string, callback: ResultCallback<ObjectLockInfo>): void
getObjectLockConfig(bucketName: string): void
async getObjectLockConfig(bucketName: string): Promise<ObjectLockInfo>
Expand Down

0 comments on commit 6b78c87

Please sign in to comment.