src/iteration/neighbors.js
function forEachInObject(nodeData, object, callback) {
  for (const k in object) {
    let edgeData = object[k];

    if (edgeData instanceof Set)
      edgeData = edgeData.values().next().value;

    const sourceData = edgeData.source,
          targetData = edgeData.target;

    const neighborData = sourceData === nodeData ? targetData : sourceData;

    callback(
      neighborData.key,
      neighborData.attributes
    );
  }
}
function forEachInObject(nodeData, object, callback) {
  for (const k in object) {
    let edgeData = object[k];

    if (edgeData instanceof Set)
      edgeData = edgeData.values().next().value;

    const sourceData = edgeData.source,
          targetData = edgeData.target;

    const neighborData = sourceData === nodeData ? targetData : sourceData;

    callback(
      neighborData.key,
      neighborData.attributes
    );
  }
}
function forEachInObject ( nodeData , object , callback ) { for ( const k in object ) { let edgeData = object [ k ] ; if ( edgeData instanceof Set ) edgeData = edgeData . values ( ) . next ( ) . value ; const sourceData = edgeData . source , targetData = edgeData . target ; const neighborData = sourceData === nodeData ? targetData : sourceData ; callback ( neighborData . key , neighborData . attributes ) ; } }
Function iterating over the given node's relevant neighbors using a
callback.

@param  {string}   type      - Type of neighbors.
@param  {string}   direction - Direction.
@param  {any}      nodeData  - Target node's data.
@param  {function} callback  - Callback to use.
Function iterating over the given node s relevant neighbors using a callback .