code: function createEdgeIterator(graph, type) {
    if (graph.size === 0)
      return Iterator.empty();
  
    let iterator;
  
    if (type === 'mixed') {
      iterator = graph._edges.values();
  
      return new Iterator(function next() {
        const step = iterator.next();
  
        if (step.done)
          return step;
  
        const data = step.value;
  
        const value = [
          data.key,
          data.attributes,
          data.source.key,
          data.target.key,
          data.source.attributes,
          data.target.attributes
        ];
  
        return {value, done: false};
      });
    }
  
    iterator = graph._edges.values();
  
    return new Iterator(function next() {
      const step = iterator.next();
  
      if (step.done)
        return step;
  
      const data = step.value;
  
      if ((data instanceof UndirectedEdgeData) === (type === 'undirected')) {
        const value = [
          data.key,
          data.attributes,
          data.source.key,
          data.target.key,
          data.source.attributes,
          data.target.attributes
        ];
  
        return {value, done: false};
      }
  
      return next();
    });
  }
docs: Function creating an iterator of edges for the given type.
  
  @param  {Graph}    graph - Target Graph instance.
  @param  {string}   type  - Type of edges to retrieve.
  @return {Iterator}