mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-25 04:34:06 -08:00
⚡ Add smallerEqual and largerEqual to IF and Switch Nodes
This commit is contained in:
parent
81ca11cb59
commit
2b343a4aa5
|
@ -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]*)$'));
|
||||
|
||||
|
|
|
@ -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]*)$'));
|
||||
|
||||
|
|
Loading…
Reference in a new issue