code: function VerticesToEdgesPipe(graph, mode, filter) {
    if (!(this instanceof VerticesToEdgesPipe)) {
      return new VerticesToEdgesPipe(graph, mode, filter);
    }
    BasePipe.call(this);
  
    var customMatch = typeof filter !== 'undefined' ?
                       createFilter(filter) : function () { return true; }
  
    this._graph = graph;
    this._mode = mode;
    this._currentEdgesIterator = createEmptyIterator();
    if (mode === 'out') {
      this._matchModeFilter = function (edge, vertexId) {
        return edge.fromId === vertexId && customMatch(edge);
      }
    } else if (mode === 'in') {
      this._matchModeFilter = function (edge, vertexId) {
        return edge.toId === vertexId && customMatch(edge);
      }
    } else if (mode === 'both') {
      this._matchModeFilter = function (edge, vertexId) {
        return customMatch(edge);
      }
    } else {
      throw new Error("Unsupported mode of VerticesToEdgesPipe. Expected (out|in|both), got: " + mode);
    }
  }
docs: Depending on `mode` emitted edges are:
  
  * `out` - emits outgoing edges
  * `in` - emits incoming edges
  * `both` - emits both `in` and `out` edges
  
  See [Syntactic Sugar](../pipeSugar.html) for more examples;
  
  Results can be filtered based on edge attributes with `filter` attribute.
  See [Filtering Pipes](../utils/filterExpression.html).