This is an automated email from the ASF dual-hosted git repository.

shanedell pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/daffodil-vscode.git


The following commit(s) were added to refs/heads/main by this push:
     new 76c7b06  Fix check for using default values
76c7b06 is described below

commit 76c7b068846e34cc70354754fc2a6bbb717f2dbc
Author: Shane Dell <[email protected]>
AuthorDate: Fri Nov 10 11:49:09 2023 -0500

    Fix check for using default values
    
    - The check used for seeing if default values or not was working improperly 
as it was checking the boolean-ness of a variable.
      - So, if the value provided was false it would still use a default value.
      - To fix the issue we need to check if accessing the varaible returns 
undefined meaning it wasn't provided so use the default then.
    
    Closes #852
---
 src/utils.ts | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/utils.ts b/src/utils.ts
index b73c6a7..d643b74 100644
--- a/src/utils.ts
+++ b/src/utils.ts
@@ -125,9 +125,10 @@ export function getConfig(jsonArgs: object): 
vscode.DebugConfiguration {
 
   Object.entries(defaultValues).map(
     ([key, defaultValue]) =>
-      (launchConfigArgs[key] = launchConfigArgs[key]
-        ? launchConfigArgs[key]
-        : defaultValue)
+      (launchConfigArgs[key] =
+        launchConfigArgs[key] !== undefined
+          ? launchConfigArgs[key]
+          : defaultValue)
   )
 
   return JSON.parse(JSON.stringify(launchConfigArgs))

Reply via email to