mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
fix: Filter component - improve errors (#10456)
This commit is contained in:
15
packages/nodes-base/nodes/If/V2/utils.ts
Normal file
15
packages/nodes-base/nodes/If/V2/utils.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import type { IExecuteFunctions } from 'n8n-workflow';
|
||||
|
||||
export const getTypeValidationStrictness = (version: number) => {
|
||||
return `={{ ($nodeVersion < ${version} ? $parameter.options.looseTypeValidation : $parameter.looseTypeValidation) ? "loose" : "strict" }}`;
|
||||
};
|
||||
|
||||
export const getTypeValidationParameter = (version: number) => {
|
||||
return (context: IExecuteFunctions, itemIndex: number, option: boolean | undefined) => {
|
||||
if (context.getNode().typeVersion < version) {
|
||||
return option;
|
||||
} else {
|
||||
return context.getNodeParameter('looseTypeValidation', itemIndex, false) as boolean;
|
||||
}
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user