mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-15 09:04:07 -08:00
61ac0c7775
Some checks are pending
Test Master / install-and-build (push) Waiting to run
Test Master / Unit tests (18.x) (push) Blocked by required conditions
Test Master / Unit tests (20.x) (push) Blocked by required conditions
Test Master / Unit tests (22.4) (push) Blocked by required conditions
Test Master / Lint (push) Blocked by required conditions
Test Master / Notify Slack on failure (push) Blocked by required conditions
16 lines
600 B
TypeScript
16 lines
600 B
TypeScript
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;
|
|
}
|
|
};
|
|
};
|