packages/reftools/lib/toposort.js
function hasIncomingEdge(list, node) {
    for (var i = 0, l = list.length; i < l; ++i) {
      if (list[i].links.find(function(e,i,a){
        return node._id == e;
      })) return true;
    }
    return false;
  }
function hasIncomingEdge(list, node) {
    for (var i = 0, l = list.length; i < l; ++i) {
      if (list[i].links.find(function(e,i,a){
        return node._id == e;
      })) return true;
    }
    return false;
  }
function hasIncomingEdge ( list , node ) { for ( var i = 0 , l = list . length ; i < l ; ++ i ) { if ( list [ i ] . links . find ( function ( e , i , a ) { return node . _id == e ; } ) ) return true ; } return false ; }
Test if a node has got any incoming edges
Test if a node has got any incoming edges