      if (!(node instanceof go.Node)) return;
      if (node instanceof go.Group) {
        var externals = node.findExternalLinksConnected();
        var next = null;
        externals.each((link) => {
          if (link.fromNode.isMemberOf(node)) next = link.toNode;
        });
        if (next) {
          externals.each((link) => {
            if (link.toNode.isMemberOf(node)) link.toNode = next;
          });
        }
      } else if (node.category === '') {
        var next = node.findNodesOutOf().fi