private getFilteredConnectors()

in src/components/node/Node.tsx [79:96]


  private getFilteredConnectors(): ConnectorProps[] {
    const connectorProps = this.getConnectors();

    if (!this.props.visibleConnectorTypes) {
      return connectorProps;
    }

    const { INPUT, OUTPUT } = ConnectorType;
    switch (this.props.visibleConnectorTypes) {
      case VisibleConnectorTypes.INPUT_ONLY:
        return connectorProps.filter(connectorProp => connectorProp.type === INPUT);
      case VisibleConnectorTypes.OUTPUT_ONLY:
        return connectorProps.filter(connectorProp => connectorProp.type === OUTPUT);
      case VisibleConnectorTypes.NONE:
        return [];
    }
    return connectorProps;
  }