code: function createEdgeArray(graph, type) {
    if (graph.size === 0)
      return [];
  
    if (type === 'mixed' || type === graph.type)
      return take(graph._edges.keys(), graph._edges.size);
  
    const size = type === 'undirected' ?
      graph.undirectedSize :
      graph.directedSize;
  
    const list = new Array(size),
          mask = type === 'undirected';
  
    let i = 0;
  
    graph._edges.forEach((data, edge) => {
  
      if ((data instanceof UndirectedEdgeData) === mask)
        list[i++] = edge;
    });
  
    return list;
  }
docs: Function creating an array of edges for the given type.
  
  @param  {Graph}   graph - Target Graph instance.
  @param  {string}  type  - Type of edges to retrieve.
  @return {array}         - Array of edges.