Skip to content

Commit

Permalink
Check against multiple values for ==
Browse files Browse the repository at this point in the history
  • Loading branch information
HaveAGitGat committed May 7, 2024
1 parent 6a2aa79 commit e5dc350
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@ const details = (): IpluginDetails => ({
inputUI: {
type: 'text',
},
tooltip: 'Value of variable to check',
tooltip: `Value of variable to check.
For == condition, you can specify multiple values separated by comma. For example: value1,value2,value3
If the variable matches any of the values, the condition is true.
`,
},
],
outputs: [
Expand Down Expand Up @@ -123,8 +126,9 @@ const plugin = (args: IpluginInputArgs): IpluginOutputArgs => {
let outputNumber = 1;

if (condition === '==') {
if (targetValue === value) {
args.jobLog(`Variable ${variable} of value ${targetValue} matches condition ${condition} ${value}`);
const valuesArr = value.trim().split(',');
if (valuesArr.includes(targetValue)) {
args.jobLog(`Variable ${variable} of value ${targetValue} matches condition ${condition} ${valuesArr}`);
outputNumber = 1;
} else {
args.jobLog(`Variable ${variable} of value ${targetValue} does not match condition ${condition} ${value}`);
Expand Down

0 comments on commit e5dc350

Please sign in to comment.