mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-12 23:54:07 -08:00
2febc61ec9
Github issue / Community forum post (link here to close automatically): https://community.n8n.io/t/add-more-outputs-to-switch-node/3864 --------- Signed-off-by: Oleg Ivaniv <me@olegivaniv.com>
26 lines
728 B
TypeScript
26 lines
728 B
TypeScript
import type { INodeTypeBaseDescription, IVersionedNodeType } from 'n8n-workflow';
|
|
import { VersionedNodeType } from 'n8n-workflow';
|
|
|
|
import { SwitchV1 } from './V1/SwitchV1.node';
|
|
import { SwitchV2 } from './V2/SwitchV2.node';
|
|
|
|
export class Switch extends VersionedNodeType {
|
|
constructor() {
|
|
const baseDescription: INodeTypeBaseDescription = {
|
|
displayName: 'Switch',
|
|
name: 'switch',
|
|
icon: 'fa:map-signs',
|
|
group: ['transform'],
|
|
description: 'Route items depending on defined expression or rules',
|
|
defaultVersion: 2,
|
|
};
|
|
|
|
const nodeVersions: IVersionedNodeType['nodeVersions'] = {
|
|
1: new SwitchV1(baseDescription),
|
|
2: new SwitchV2(baseDescription),
|
|
};
|
|
|
|
super(nodeVersions, baseDescription);
|
|
}
|
|
}
|