From 1d55517f798d670b590f0eb3c28aaf9f1b219200 Mon Sep 17 00:00:00 2001 From: Sydney Achinger Date: Tue, 1 Apr 2025 14:09:26 -0400 Subject: [PATCH] Fix tsc error. Signed-off-by: Sydney Achinger --- .../src/stages/publish/azureBlobStorage.ts | 49 ++++++++++--------- 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/plugins/techdocs-node/src/stages/publish/azureBlobStorage.ts b/plugins/techdocs-node/src/stages/publish/azureBlobStorage.ts index 9d257312dd..41d2a96bab 100644 --- a/plugins/techdocs-node/src/stages/publish/azureBlobStorage.ts +++ b/plugins/techdocs-node/src/stages/publish/azureBlobStorage.ts @@ -295,29 +295,31 @@ export class AzureBlobStoragePublish implements PublisherBase { : lowerCaseEntityTriplet(entityTriplet); try { - const techdocsMetadataJson = await new Promise((resolve, reject) => { - const fileStreamChunks: Array = []; - this.storageClient - .getContainerClient(this.containerName) - .getBlockBlobClient(`${entityRootDir}/techdocs_metadata.json`) - .download() - .then(res => { - const body = res.readableStreamBody; - if (!body) { - reject(new Error(`Unable to parse the response data`)); - return; - } - body - .on('error', reject) - .on('data', chunk => { - fileStreamChunks.push(chunk); - }) - .on('end', () => { - resolve(Buffer.concat(fileStreamChunks)); - }); - }) - .catch(reject); - }); + const techdocsMetadataJson = await new Promise( + (resolve, reject) => { + const fileStreamChunks: Array = []; + this.storageClient + .getContainerClient(this.containerName) + .getBlockBlobClient(`${entityRootDir}/techdocs_metadata.json`) + .download() + .then(res => { + const body = res.readableStreamBody; + if (!body) { + reject(new Error(`Unable to parse the response data`)); + return; + } + body + .on('error', reject) + .on('data', chunk => { + fileStreamChunks.push(chunk); + }) + .on('end', () => { + resolve(Buffer.concat(fileStreamChunks)); + }); + }) + .catch(reject); + }, + ); if (!techdocsMetadataJson) { throw new Error( @@ -360,7 +362,6 @@ export class AzureBlobStoragePublish implements PublisherBase { if (!downloadRes.readableStreamBody) { throw new Error('Unable to parse the response data'); } - // Set headers after confirming file exists and can be downloaded for (const [headerKey, headerValue] of Object.entries( responseHeaders, )) {