mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-10 14:44:05 -08:00
fix(IF Node): bug when null isn't considerate empty in isEmpty and isNotEmpty comparison
This commit is contained in:
parent
4810a4f58a
commit
0cdc2e9dc8
|
@ -346,13 +346,13 @@ export class If implements INodeType {
|
||||||
notStartsWith: (value1: NodeParameterValue, value2: NodeParameterValue) =>
|
notStartsWith: (value1: NodeParameterValue, value2: NodeParameterValue) =>
|
||||||
!(value1 as string).startsWith(value2 as string),
|
!(value1 as string).startsWith(value2 as string),
|
||||||
isEmpty: (value1: NodeParameterValue) =>
|
isEmpty: (value1: NodeParameterValue) =>
|
||||||
[undefined, null, ''].includes(value1 as string) ||
|
[undefined, null, '', NaN].includes(value1 as string) ||
|
||||||
(typeof value1 === 'object' && value1 !== null
|
(typeof value1 === 'object' && value1 !== null
|
||||||
? Object.entries(value1 as string).length === 0
|
? Object.entries(value1 as string).length === 0
|
||||||
: false),
|
: false),
|
||||||
isNotEmpty: (value1: NodeParameterValue) =>
|
isNotEmpty: (value1: NodeParameterValue) =>
|
||||||
!(
|
!(
|
||||||
[undefined, null, ''].includes(value1 as string) ||
|
[undefined, null, '', NaN].includes(value1 as string) ||
|
||||||
(typeof value1 === 'object' && value1 !== null
|
(typeof value1 === 'object' && value1 !== null
|
||||||
? Object.entries(value1 as string).length === 0
|
? Object.entries(value1 as string).length === 0
|
||||||
: false)
|
: false)
|
||||||
|
|
Loading…
Reference in a new issue