Skip to content

Commit

Permalink
Update jsonVariableSubstitutionUtility.ts
Browse files Browse the repository at this point in the history
Removed exposure of secrets
  • Loading branch information
marigbede authored Mar 27, 2023
1 parent 4b5a6fe commit 177f212
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/operations/jsonVariableSubstitutionUtility.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,22 @@ export class JsonSubstitution {
if(resultNode.isEnd) {
switch(typeof(jsonObject[jsonChild])) {
case 'number':
console.log('SubstitutingValueonKeyWithNumber', jsonChild , resultNode.value);
//console.log('SubstitutingValueonKeyWithNumber', jsonChild , resultNode.value);
console.log('SubstitutingValueonKeyWithString' , jsonChild);
jsonObject[jsonChild] = !isNaN(resultNode.value) ? Number(resultNode.value): resultNode.value;
break;
case 'boolean':
console.log('SubstitutingValueonKeyWithBoolean' , jsonChild , resultNode.value);
//console.log('SubstitutingValueonKeyWithBoolean' , jsonChild , resultNode.value);
console.log('SubstitutingValueonKeyWithString' , jsonChild);
jsonObject[jsonChild] = (
resultNode.value == 'true' ? true : (resultNode.value == 'false' ? false : resultNode.value)
)
break;
case 'object':
case null:
try {
console.log('SubstitutingValueonKeyWithObject' , jsonChild , resultNode.value);
//console.log('SubstitutingValueonKeyWithObject' , jsonChild , resultNode.value);
console.log('SubstitutingValueonKeyWithString' , jsonChild);
jsonObject[jsonChild] = JSON.parse(resultNode.value);
}
catch(exception) {
Expand All @@ -37,7 +40,8 @@ export class JsonSubstitution {
}
break;
case 'string':
console.log('SubstitutingValueonKeyWithString' , jsonChild , resultNode.value);
//console.log('SubstitutingValueonKeyWithString' , jsonChild , resultNode.value);
console.log('SubstitutingValueonKeyWithString' , jsonChild);
jsonObject[jsonChild] = resultNode.value;
}
isValueChanged = true;
Expand All @@ -51,4 +55,4 @@ export class JsonSubstitution {
}

private envTreeUtil: EnvTreeUtility;
}
}

0 comments on commit 177f212

Please sign in to comment.