code: function findDep (obj, d) {
    var r = obj
      , found = null
    while (r && !found) {
      // if r is a valid choice, then use that.
      // kinda weird if a pkg depends on itself, but after the first
      // iteration of this loop, it indicates a dep cycle.
      if (typeof r.dependencies[d] === "object") {
        found = r.dependencies[d]
      }
      if (!found && r.realName === d) found = r
      r = r.link ? null : r.parent
    }
    return found
  }
docs: Find the one that will actually be loaded by require() so we can make sure it's valid etc.