From 35cd5b72d3e956f83f4c4cf90870c98caeed4927 Mon Sep 17 00:00:00 2001 From: Vishal Shanbhag Date: Sun, 25 May 2025 23:48:02 -0700 Subject: [PATCH 1/2] fix(DOSTM_7438): Review comment fix --- build/index.js | 8 ++++---- src/index.ts | 2 +- src/sdk-version-utils.ts | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/build/index.js b/build/index.js index 10e0a6c..da678b2 100644 --- a/build/index.js +++ b/build/index.js @@ -37313,7 +37313,7 @@ const con = __importStar(__nccwpck_require__(9042)); const sdk_version_utils_js_1 = __nccwpck_require__(7796); const utils = new sdk_version_utils_js_1.SdkVersionUtils(); const osPlat = os_1.default.platform(); -const isWinPlatform = (osPlat == con.OS_PLATFORM_WIN) ? true : false; +const isWinPlatform = (osPlat === con.OS_PLATFORM_WIN); const signtools = isWinPlatform ? con.WIN_OS_TOOL_LIST : con.OTHER_OS_TOOL_LIST; const toolInstaller = async (toolName, toolPath = "") => { let cacheDir; @@ -37451,9 +37451,9 @@ class SdkVersionUtils { return numArr; } getAllSdkVersions(dirPath, sdkVersions = []) { - fs_1.default.readdirSync(dirPath, { withFileTypes: true }).forEach(file => { - if (this.isVersionDirectory(file.name)) { - sdkVersions.push(file.name); + fs_1.default.readdirSync(dirPath, { withFileTypes: true }).forEach(({ name }) => { + if (this.isVersionDirectory(name)) { + sdkVersions.push(name); } }); return sdkVersions; diff --git a/src/index.ts b/src/index.ts index 8504815..7a3044c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -10,7 +10,7 @@ import { SdkVersionUtils } from "./sdk-version-utils.js"; const utils = new SdkVersionUtils(); const osPlat: string = os.platform(); -const isWinPlatform = (osPlat == con.OS_PLATFORM_WIN) ? true : false; +const isWinPlatform = (osPlat === con.OS_PLATFORM_WIN); const signtools = isWinPlatform ? con.WIN_OS_TOOL_LIST : con.OTHER_OS_TOOL_LIST; const toolInstaller = async (toolName: string, toolPath: string = "") => { let cacheDir; diff --git a/src/sdk-version-utils.ts b/src/sdk-version-utils.ts index 357b391..43306dd 100644 --- a/src/sdk-version-utils.ts +++ b/src/sdk-version-utils.ts @@ -39,9 +39,9 @@ export class SdkVersionUtils { } public getAllSdkVersions(dirPath: any, sdkVersions: any = []): any { - fs.readdirSync(dirPath, {withFileTypes: true}).forEach(file => { - if(this.isVersionDirectory(file.name)){ - sdkVersions.push(file.name) + fs.readdirSync(dirPath, {withFileTypes: true}).forEach(({ name }) => { + if(this.isVersionDirectory(name)){ + sdkVersions.push(name) } }); return sdkVersions; From ae54e8a7588fd91e761d30f1a59c524aa12121ec Mon Sep 17 00:00:00 2001 From: Vishal Shanbhag Date: Mon, 26 May 2025 13:39:40 +0530 Subject: [PATCH 2/2] Update index.js for fixing scan failure --- build/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/index.js b/build/index.js index da678b2..35926ec 100644 --- a/build/index.js +++ b/build/index.js @@ -36525,7 +36525,7 @@ function buildProxyBypassRegexFromEnv(bypass) { } catch (err) { if (err instanceof SyntaxError && (bypass || "").startsWith("*")) { - let wildcardEscaped = bypass.replace('*', '(.*)'); + let wildcardEscaped = bypass.replace(/\*/g, '(.*)'); return new RegExp(wildcardEscaped, 'i'); } throw err; @@ -37698,4 +37698,4 @@ module.exports = JSON.parse('{"name":"dotenv","version":"16.0.3","description":" /******/ module.exports = __webpack_exports__; /******/ /******/ })() -; \ No newline at end of file +;