From f42c442204aee8e959b3b7fc890dde7c0e5cf0d5 Mon Sep 17 00:00:00 2001 From: Trae Yelovich Date: Tue, 19 Sep 2023 14:16:14 -0400 Subject: [PATCH] fix(ftp): access/modify object properties directly Signed-off-by: Trae Yelovich --- .../src/ZoweExplorerFtpMvsApi.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/zowe-explorer-ftp-extension/src/ZoweExplorerFtpMvsApi.ts b/packages/zowe-explorer-ftp-extension/src/ZoweExplorerFtpMvsApi.ts index 59da88dbf3..75bd6bfaac 100644 --- a/packages/zowe-explorer-ftp-extension/src/ZoweExplorerFtpMvsApi.ts +++ b/packages/zowe-explorer-ftp-extension/src/ZoweExplorerFtpMvsApi.ts @@ -149,15 +149,15 @@ export class FtpMvsApi extends AbstractFtpApi implements ZoweExplorerApi.IMvs { } const lrecl: number = dsAtrribute.apiResponse.items[0].lrecl; const data = fs.readFileSync(inputFilePath, { encoding: "utf8" }); - const transferOptions = { + const transferOptions: Record = { transferType: options.binary ? TRANSFER_TYPE_BINARY : TRANSFER_TYPE_ASCII, localFile: inputFilePath, encoding: options.encoding, }; - if (profile.profile["secureFtp"] && data == "") { + if (profile.profile.secureFtp && data == "") { // substitute single space for empty DS contents when saving (avoids FTPS error) - transferOptions["content"] = " "; - delete transferOptions["localFile"]; + transferOptions.content = " "; + delete transferOptions.localFile; } const lines = data.split(/\r?\n/); const foundIndex = lines.findIndex((line) => line.length > lrecl); @@ -252,7 +252,7 @@ export class FtpMvsApi extends AbstractFtpApi implements ZoweExplorerApi.IMvs { const transferOptions = { transferType: options.binary ? TRANSFER_TYPE_BINARY : TRANSFER_TYPE_ASCII, // we have to provide a single space for content over FTPS, or it will fail to upload - content: profile.profile["secureFtp"] ? " " : "", + content: profile.profile.secureFtp ? " " : "", encoding: options.encoding, }; const result = this.getDefaultResponse();