Skip to content

Commit

Permalink
Fixed typescript issue
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderYW committed Apr 1, 2023
1 parent c341049 commit 2f4be8c
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/Drivers/index.ts
Expand Up @@ -69,7 +69,7 @@ export class AzureStorageDriver implements AzureStorageDriverContract {
)
} else {
// eslint-disable-next-line no-undef-init
let credential: StorageSharedKeyCredential | DefaultAzureCredential = undefined
let credential: StorageSharedKeyCredential | DefaultAzureCredential | undefined = undefined
if (config.azure_tenant_id && config.azure_client_id && config.azure_client_secret) {
credential = new DefaultAzureCredential()
} else if (config.name && config.key) {
Expand All @@ -85,7 +85,7 @@ export class AzureStorageDriver implements AzureStorageDriverContract {
const azurePipeline = newPipeline(credential)

this.adapter = new BlobServiceClient(url, azurePipeline)
this.azureContainer = this.adapter.getContainerClient(this.config.container)
this.azureContainer = this.adapter.getContainerClient(this.config.container!)
}
}

Expand All @@ -98,7 +98,7 @@ export class AzureStorageDriver implements AzureStorageDriverContract {
}

public getBlockBlobClient(location: string) {
const container = this.config.container as string
const container = this.config.container! as string

const containerClient = this.adapter.getContainerClient(container)
return containerClient.getBlockBlobClient(location)
Expand Down Expand Up @@ -225,9 +225,9 @@ export class AzureStorageDriver implements AzureStorageDriverContract {
*/
public async getSignedUrl(location: string, options?: BlobSASSignatureValues): Promise<string> {
options = options || {
containerName: this.config.container as string,
containerName: this.config.container! as string,
}
options.containerName = options.containerName || (this.config.container as string)
options.containerName = options.containerName || (this.config.container! as string)

try {
const blockBlobClient = this.getBlockBlobClient(location)
Expand Down Expand Up @@ -295,9 +295,9 @@ export class AzureStorageDriver implements AzureStorageDriverContract {
options?: BlobSASSignatureValues
): Promise<void> {
options = options || {
containerName: this.config.container as string,
containerName: this.config.container! as string,
}
options.containerName = options.containerName || (this.config.container as string)
options.containerName = options.containerName || (this.config.container! as string)

const sourceBlockBlobClient = this.getBlockBlobClient(source)
const destinationBlockBlobClient = this.getBlockBlobClient(destination)
Expand Down

0 comments on commit 2f4be8c

Please sign in to comment.