Add smallerEqual and largerEqual to IF and Switch Nodes

This commit is contained in:
Jan Oberhauser 2019-12-23 13:22:15 -06:00
parent 81ca11cb59
commit 2b343a4aa5
2 changed files with 20 additions and 0 deletions

View file

@ -92,6 +92,10 @@ export class If implements INodeType {
name: 'Smaller',
value: 'smaller'
},
{
name: 'Smaller Equal',
value: 'smallerEqual'
},
{
name: 'Equal',
value: 'equal'
@ -104,6 +108,10 @@ export class If implements INodeType {
name: 'Larger',
value: 'larger'
},
{
name: 'Larger Equal',
value: 'largerEqual'
},
],
default: 'smaller',
description: 'Operation to decide where the the data should be mapped to.',
@ -231,7 +239,9 @@ export class If implements INodeType {
equal: (value1: NodeParameterValue, value2: NodeParameterValue) => value1 === value2,
notEqual: (value1: NodeParameterValue, value2: NodeParameterValue) => value1 !== value2,
larger: (value1: NodeParameterValue, value2: NodeParameterValue) => value1 > value2,
largerEqual: (value1: NodeParameterValue, value2: NodeParameterValue) => value1 >= value2,
smaller: (value1: NodeParameterValue, value2: NodeParameterValue) => value1 < value2,
smallerEqual: (value1: NodeParameterValue, value2: NodeParameterValue) => value1 <= value2,
regex: (value1: NodeParameterValue, value2: NodeParameterValue) => {
const regexMatch = value2.toString().match(new RegExp('^/(.*?)/([gimy]*)$'));

View file

@ -239,6 +239,10 @@ export class Switch implements INodeType {
name: 'Smaller',
value: 'smaller'
},
{
name: 'Smaller Equal',
value: 'smallerEqual'
},
{
name: 'Equal',
value: 'equal'
@ -251,6 +255,10 @@ export class Switch implements INodeType {
name: 'Larger',
value: 'larger'
},
{
name: 'Larger Equal',
value: 'largerEqual'
},
],
default: 'smaller',
description: 'Operation to decide where the the data should be mapped to.',
@ -465,7 +473,9 @@ export class Switch implements INodeType {
equal: (value1: NodeParameterValue, value2: NodeParameterValue) => value1 === value2,
notEqual: (value1: NodeParameterValue, value2: NodeParameterValue) => value1 !== value2,
larger: (value1: NodeParameterValue, value2: NodeParameterValue) => value1 > value2,
largerEqual: (value1: NodeParameterValue, value2: NodeParameterValue) => value1 >= value2,
smaller: (value1: NodeParameterValue, value2: NodeParameterValue) => value1 < value2,
smallerEqual: (value1: NodeParameterValue, value2: NodeParameterValue) => value1 <= value2,
regex: (value1: NodeParameterValue, value2: NodeParameterValue) => {
const regexMatch = value2.toString().match(new RegExp('^/(.*?)/([gimy]*)$'));